-
Notifications
You must be signed in to change notification settings - Fork 0
/
database-creation.sql
53 lines (37 loc) · 1.96 KB
/
database-creation.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
-- Designated sql code to create exactly the same database structure as PhoenIntel.
-- use this code (for example in phpmyadmin, in the "sql" section) to create exactly the same database structure.
CREATE TABLE liens (
id INT AUTO_INCREMENT PRIMARY KEY,
titre VARCHAR(255),
url VARCHAR(255)
);
ALTER TABLE liens ADD COLUMN description TEXT;
ALTER TABLE liens MODIFY url VARCHAR(2048);
ALTER TABLE liens ADD timestamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP;
SELECT * FROM liens ORDER BY timestamp DESC;
ALTER TABLE liens ADD date TIMESTAMP DEFAULT CURRENT_TIMESTAMP;
INSERT INTO `liens` (`id`, `titre`, `url`, `description`, `timestamp`, `date`) VALUES (NULL, 'Link title will appear here', 'https://www.phoen.org', 'Link description will appear here', '2000-01-01 00:00:00', '2000-01-01 00:00:00')
CREATE TABLE partners (
id INT AUTO_INCREMENT PRIMARY KEY,
titre VARCHAR(255),
url VARCHAR(255)
);
ALTER TABLE partners ADD COLUMN description TEXT;
ALTER TABLE partners MODIFY url VARCHAR(2048);
ALTER TABLE partners ADD timestamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP;
SELECT * FROM partners ORDER BY timestamp DESC;
ALTER TABLE partners ADD date TIMESTAMP DEFAULT CURRENT_TIMESTAMP;
INSERT INTO `partners` (`id`, `titre`, `url`, `description`, `timestamp`, `date`) VALUES (NULL, 'Partner name will appear here', 'https://www.phoen.org', 'Partner description will appear here', '2000-01-01 00:00:00', '2000-01-01 00:00:00')
CREATE TABLE identifiants (
id INT AUTO_INCREMENT PRIMARY KEY,
identifiant VARCHAR(100),
nom_complet VARCHAR(255),
raccourci_nom VARCHAR(10),
code_pays VARCHAR(2),
niveau INT,
numero_membre INT,
date_adhesion DATE,
statut_temporaire VARCHAR(1),
code_pin INT
);
INSERT INTO `identifiants` (`id`, `identifiant`, `nom_complet`, `raccourci_nom`, `code_pays`, `niveau`, `numero_membre`, `date_adhesion`, `statut_temporaire`, `code_pin`) VALUES (NULL, 'exampleid', 'example', 'EXAMPLE', 'AA', '0', '0', '2000-01-01', '0', '0000')