diff --git a/share/schema.sql b/share/schema.sql index be2888e..791d02f 100644 --- a/share/schema.sql +++ b/share/schema.sql @@ -4,8 +4,10 @@ CREATE TABLE source_files ( filename TEXT UNIQUE NOT NULL, size INTEGER NOT NULL, hash TEXT, + mime_type INTEGER, last_change INTEGER NOT NULL DEFAULT (strftime('%s','now')), - last_seen INTEGER NOT NULL DEFAULT (strftime('%s','now')) + last_seen INTEGER NOT NULL DEFAULT (strftime('%s','now')), + FOREIGN KEY (mime_type) REFERENCES mime_types(id) ); CREATE TABLE destinations ( id INTEGER PRIMARY KEY, @@ -20,6 +22,12 @@ CREATE TABLE destination_files ( FOREIGN KEY (source_file_id) REFERENCES source_files(id), FOREIGN KEY (destination_id) REFERENCES destinations(id) ); +CREATE TABLE mime_types ( + id INTEGER PRIMARY KEY, + destination_id INTEGER, + mime_text TEXT UNIQUE NOT NULL, + action INTEGER DEFAULT 1 +); CREATE INDEX sourcefiles_by_name ON source_files (filename,id);