-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdb.sql
53 lines (48 loc) · 993 Bytes
/
db.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
DROP DATABASE IF EXISTS link;
CREATE DATABASE link;
\c link;
CREATE TABLE Main (
id SERIAL PRIMARY KEY,
link TEXT,
title TEXT,
tags TEXT,
added BIGINT,
doc TEXT,
rating SMALLINT,
read VARCHAR,
edit VARCHAR,
lastedit BIGINT,
report TEXT,
relation TEXT,
lib TEXT
);
CREATE TABLE Temp (
id SERIAL PRIMARY KEY,
link TEXT,
title TEXT,
tags TEXT,
added BIGINT,
doc TEXT,
rating SMALLINT,
read VARCHAR,
edit VARCHAR,
lastedit BIGINT,
report TEXT,
relation TEXT,
lib TEXT,
origin TEXT
);
INSERT INTO Main (
link, title, tags, added, doc, rating, read, edit,
lastedit, report, relation, lib
) VALUES (
'link', 'title', 'tags', '1', 'doc', '2', 'read', 'edit',
'1', 'report', 'relation', 'lib'
);
INSERT INTO Temp (
link, title, tags, added, doc, rating, read, edit,
lastedit, report, relation, lib
) VALUES (
'link', 'title', 'tags', '1518961075570', 'doc', '3', 'read', 'edit',
'1518961075570', 'report', 'relation', 'lib'
);