-
Notifications
You must be signed in to change notification settings - Fork 3
/
db-v2.sql
53 lines (53 loc) · 1.33 KB
/
db-v2.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
create table _yamanote_db_state (schemaVersion integer not null);
insert into
_yamanote_db_state (schemaVersion)
values
(2);
create table user (
id INTEGER PRIMARY KEY,
name text unique not null,
hashed text not null,
salt text not null,
iterations integer not null,
keylen integer not null,
digest text not null
);
create table bookmark (
id INTEGER PRIMARY KEY AUTOINCREMENT,
userId integer not null,
url text not null,
title text not null,
createdTime float not null,
modifiedTime float not null,
render text not null,
renderedTime float not null,
unique (url, title)
);
create table comment (
id INTEGER PRIMARY KEY,
bookmarkId integer not null,
content text not null,
createdTime float not null,
modifiedTime float not null,
render text not null,
renderedTime float not null
);
create table backup (
id INTEGER PRIMARY KEY,
bookmarkId integer not null,
content text not null,
original text not null,
createdTime float not null
);
create table media (
id INTEGER PRIMARY KEY,
path text not null,
-- url or filename
mime text not null,
-- TODO: allow same checksum, multiple filenames
-- TODO: prevent users from seeing other users' media by knowing the id/checksum
content blob not null,
createdTime float not null,
numBytes integer not null,
unique (path, createdTime)
);