fix schema
This commit is contained in:
parent
c2be5814fa
commit
fef9d5d5d6
@ -1,24 +1,26 @@
|
|||||||
BEGIN TRANSACTION;
|
BEGIN TRANSACTION;
|
||||||
CREATE TABLE source_files (
|
CREATE TABLE source_files (
|
||||||
id INTEGER PRIMARY KEY,
|
id INTEGER PRIMARY KEY,
|
||||||
filename TEXT UNIQUE COLLATE NOT NULL,
|
filename TEXT UNIQUE NOT NULL,
|
||||||
size INTEGER NOT NULL,
|
size INTEGER NOT NULL,
|
||||||
hash TEXT,
|
hash TEXT,
|
||||||
last_change INTEGER NOT NULL DEFAULT (strftime('%s','now'))
|
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'))
|
||||||
);
|
);
|
||||||
CREATE TABLE destinations (
|
CREATE TABLE destinations (
|
||||||
id INTEGER PRIMARY KEY,
|
id INTEGER PRIMARY KEY,
|
||||||
path TEXT UNIQUE COLLATE NOT NULL
|
path TEXT UNIQUE NOT NULL
|
||||||
);
|
);
|
||||||
CREATE TABLE destination_files (
|
CREATE TABLE destination_files (
|
||||||
id INTEGER PRIMARY KEY,
|
id INTEGER PRIMARY KEY,
|
||||||
filename TEXT UNIQUE COLLATE NOT NULL,
|
filename TEXT UNIQUE NOT NULL,
|
||||||
last_change INTEGER NOT NULL DEFAULT (strftime('%s','now')),
|
last_change INTEGER NOT NULL DEFAULT (strftime('%s','now')),
|
||||||
to_delete NOT NULL DEFAULT 0,
|
to_delete NOT NULL DEFAULT 0,
|
||||||
update_needed NOT NULL DEFAULT 1,
|
update_needed NOT NULL DEFAULT 1,
|
||||||
FOREIGN KEY(source_file) REFERENCES source_files(id),
|
source_file_id INTEGER,
|
||||||
FOREIGN KEY(destination) REFERENCES destinations(id)
|
destination_id INTEGER,
|
||||||
|
FOREIGN KEY (source_file_id) REFERENCES source_files(id),
|
||||||
|
FOREIGN KEY (destination_id) REFERENCES destinations(id)
|
||||||
);
|
);
|
||||||
|
|
||||||
COMMIT;
|
COMMIT;
|
||||||
Loading…
x
Reference in New Issue
Block a user