blob: dc5a6c324f56f2cbc90ffb19dcab4304f4f58731 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
CREATE TABLE pictures (
id INTEGER PRIMARY KEY AUTOINCREMENT,
digest CHAR(32) NOT NULL
);
CREATE TABLE sentpictures (
id INTEGER PRIMARY KEY AUTOINCREMENT,
url VARCHAR(255) NOT NULL,
sender VARCHAR(100) NOT NULL,
picture_id INTEGER NOT NULL
);
CREATE TABLE signatures (
id INTEGER PRIMARY KEY AUTOINCREMENT,
compressed_signature CHAR(182) NOT NULL,
picture_id INTEGER NOT NULL
);
CREATE TABLE words (
pos_and_word CHAR(5) NOT NULL,
signature_id INTEGER NOT NULL
);
CREATE UNIQUE INDEX idx_digest ON pictures(digest);
CREATE INDEX idx_picture_id ON sentpictures (picture_id);
CREATE INDEX idx_pos_and_word ON words(pos_and_word);
CREATE UNIQUE INDEX idx_url ON sentpictures (url);
|