-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsetup.sql
54 lines (54 loc) · 1.17 KB
/
setup.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
54
--Version:1
CREATE TABLE series (
id INTEGER PRIMARY KEY AUTOINCREMENT,
remote_id INTEGER,
country VARCHAR,
format VARCHAR,
issue_count INTEGER,
"language" VARCHAR,
last_issue_id INTEGER,
"name" VARCHAR,
notes VARCHAR,
publication_dates VARCHAR,
publication_notes VARCHAR,
"year_began" INTEGER,
"year_ended" INTEGER
);
--
CREATE TABLE issues (
id INTEGER PRIMARY KEY AUTOINCREMENT,
remote_id INTEGER,
barcode VARCHAR,
indicia_frequency VARCHAR,
isbn VARCHAR,
notes VARCHAR,
"number" VARCHAR,
page_count INTEGER,
price FLOAT,
publication_date VARCHAR,
series_id INTEGER,
sort_code INTEGER,
title VARCHAR,
volume VARCHAR,
variant VARCHAR
);
--
CREATE TABLE collections (
id INTEGER PRIMARY KEY AUTOINCREMENT,
"name" VARCHAR
);
--
CREATE TABLE collection_series (
collection_id INTEGER,
series_id INTEGER,
PRIMARY KEY(collection_id,series_id)
);
--
CREATE TABLE collection_issues (
collection_id INTEGER,
issue_id INTEGER,
PRIMARY KEY(collection_id, issue_id)
);
--Version:2
ALTER TABLE series add column "publisher" VARCHAR;
--