Created
January 31, 2018 10:55
-
-
Save severak/b8b8c4d66c3f839d63f2cd83e9f37101 to your computer and use it in GitHub Desktop.
tak nějak
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE IF NOT EXISTS "meta" ( | |
"k" text NOT NULL, | |
"v" text NOT NULL, | |
PRIMARY KEY ("k") | |
); | |
CREATE TABLE IF NOT EXISTS "license" ( | |
"id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, | |
"name" text NOT NULL, | |
FOREIGN KEY ("id") REFERENCES "book" ("id") | |
); | |
CREATE TABLE IF NOT EXISTS "author" ( | |
"id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, | |
"name" text NOT NULL, | |
"firstname" text NOT NULL, | |
"lastname" text NOT NULL, | |
"info" text NOT NULL, | |
"olid" text NOT NULL, | |
"wikipedia_url" text NOT NULL | |
); | |
CREATE TABLE IF NOT EXISTS "book" ( | |
"id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, | |
"name" text NOT NULL, | |
"author_name" text NOT NULL, | |
"author_id" integer NOT NULL, | |
"category_id" integer NOT NULL, | |
"license_id" integer NOT NULL, | |
"short_info" text NOT NULL, | |
"long_info" text NOT NULL DEFAULT '', | |
"isbn" text NOT NULL, | |
"olid" text NOT NULL, | |
"wikipedia_url" text NOT NULL, | |
"download_url" text NOT NULL, | |
"mirror_url" text NOT NULL, | |
"source_url" text NOT NULL, | |
FOREIGN KEY ("license_id") REFERENCES "license" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION, | |
FOREIGN KEY ("author_id") REFERENCES "author" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment