-
Notifications
You must be signed in to change notification settings - Fork 0
/
sample.init.sql
49 lines (49 loc) · 1.73 KB
/
sample.init.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
CREATE TABLE IF NOT EXISTS events(
'ID' VARCHAR(255) PRIMARY KEY,
'Artist' VARCHAR(255),
'City' VARCHAR(255),
'Vanue' VARCHAR(255),
'Date' DATETIME UNIQUE
);
CREATE TABLE IF NOT EXISTS cookies(
'ID' INTEGER,
'Name' VARCHAR(255),
'Value' TEXT,
'Domain' VARCHAR(255),
'Expires' DATETIME,
'CreatedOn' DATETIME,
PRIMARY KEY('ID' AUTOINCREMENT)
);
CREATE TABLE IF NOT EXISTS cookies_per_log(
'ID' INTEGER,
'LogId' INTEGER,
'CookieId' INTEGER,
'CreatedOn' DATETIME,
PRIMARY KEY('ID' AUTOINCREMENT),
FOREIGN KEY (LogId) REFERENCES logs (ID),
FOREIGN KEY (CookieId) REFERENCES cookies (ID)
);
CREATE TABLE IF NOT EXISTS logs(
'ID' INTEGER,
'EventId' VARCHAR(255),
'Status' INTEGER,
'Quantity' INTEGER,
'Total' INTEGER,
'Picks' TEXT,
'Descriptions' TEXT,
'CreatedOn' DATETIME,
PRIMARY KEY('ID' AUTOINCREMENT),
FOREIGN KEY (EventId) REFERENCES events (ID)
);
CREATE TABLE IF NOT EXISTS picks(
'ID' INTEGER,
'EventId' VARCHAR(255),
'Picks' TEXT,
'CreatedOn' DATETIME,
PRIMARY KEY('ID' AUTOINCREMENT),
FOREIGN KEY (EventId) REFERENCES events (ID)
);
INSERT OR REPLACE INTO events (ID, Artist, City, Vanue, Date) VALUES('23006130DAB40C0B', 'Coldplay', 'London', 'Wembley Stadium', '2025-08-22');
INSERT OR REPLACE INTO events (ID, Artist, City, Vanue, Date) VALUES('23006130DBA60C0D', 'Coldplay', 'London', 'Wembley Stadium', '2025-08-23');
INSERT OR REPLACE INTO events (ID, Artist, City, Vanue, Date) VALUES('23006130DCBE0C15', 'Coldplay', 'London', 'Wembley Stadium', '2025-08-26');
INSERT OR REPLACE INTO events (ID, Artist, City, Vanue, Date) VALUES('23006130DD430C17', 'Coldplay', 'London', 'Wembley Stadium', '2025-08-27');