Start making create script idempotent

main
Jeffrey Elkner 2 years ago
parent 22bf231fa6
commit efe3323075

@ -1,10 +1,14 @@
BEGIN TRANSACTION;
CREATE TABLE Author(
DROP TABLE IF EXISTS "author";
DROP TABLE IF EXISTS "quote";
DROP TABLE IF EXISTS "category";
DROP TABLE IF EXISTS "quotecategory";
CREATE TABLE author(
aid SERIAL PRIMARY KEY,
fname TEXT,
lname TEXT
);
CREATE TABLE Quote(
CREATE TABLE quote(
qid SERIAL PRIMARY KEY,
qtext TEXT,
aid INTEGER,
@ -12,11 +16,11 @@ CREATE TABLE Quote(
qdate DATE,
FOREIGN KEY (aid) REFERENCES Author(aid)
);
CREATE TABLE Category(
CREATE TABLE category(
cid SERIAL PRIMARY KEY,
description TEXT
);
CREATE TABLE QuoteCategory(
CREATE TABLE quotecategory(
qid INTEGER,
cid INTEGER,
FOREIGN KEY(qid) REFERENCES Quote(qid),

Loading…
Cancel
Save