blob: 255e98dca15a626d5e0d38c9267e7b7e39a5f412 (
plain)
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
|
CREATE TABLE tags (
id integer NOT NULL PRIMARY KEY,
name varchar(255) NOT NULL,
description text
);
CREATE TABLE files (
id integer NOT NULL PRIMARY KEY,
-- TODO: just call this column 'name'
-- This will make things much easier as 'name' is
-- also used for the tag table.
canonical_name varchar(255) NOT NULL,
full_name varchar(255) NOT NULL,
description text,
date integer NOT NULL,
sum integer NOT NULL,
extension varchar(15) NOT NULL
);
CREATE TABLE file_tags (
file integer NOT NULL,
tag integer NOT NULL,
FOREIGN KEY(file) REFERENCES files(id),
FOREIGN KEY(tag) REFERENCES tags(id)
);
|