SQL: standardize id names
This commit is contained in:
parent
b044726c96
commit
c71d3af0a2
14
database.sql
14
database.sql
|
@ -1,27 +1,27 @@
|
|||
BEGIN TRANSACTION;
|
||||
CREATE TABLE IF NOT EXISTS "tags" (
|
||||
"tid" INTEGER,
|
||||
"id" INTEGER,
|
||||
"label" text,
|
||||
PRIMARY KEY("tid" AUTOINCREMENT)
|
||||
PRIMARY KEY("id" AUTOINCREMENT)
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS "files" (
|
||||
"fid" INTEGER,
|
||||
"id" INTEGER,
|
||||
"filename" text,
|
||||
PRIMARY KEY("fid" AUTOINCREMENT)
|
||||
PRIMARY KEY("id" AUTOINCREMENT)
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS "tags_ties" (
|
||||
"id" INTEGER,
|
||||
"tid" INTEGER,
|
||||
"fid" INTEGER,
|
||||
PRIMARY KEY("id" AUTOINCREMENT),
|
||||
FOREIGN KEY("tid") REFERENCES "tags_ties"("tid"),
|
||||
FOREIGN KEY("fid") REFERENCES "files"("fid")
|
||||
FOREIGN KEY("tid") REFERENCES "tags"("id"),
|
||||
FOREIGN KEY("fid") REFERENCES "files"("id")
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS "hashes" (
|
||||
"id" INTEGER,
|
||||
"md5" text,
|
||||
"fid" int,
|
||||
PRIMARY KEY("id" AUTOINCREMENT),
|
||||
FOREIGN KEY("fid") REFERENCES "files"("fid")
|
||||
FOREIGN KEY("fid") REFERENCES "files"("id")
|
||||
);
|
||||
COMMIT;
|
Loading…
Reference in New Issue