aboutsummaryrefslogtreecommitdiff
path: root/sql/init.sql
blob: 4c7332705cefab15205574ce9192313a1c91b683 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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,
       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)
);