|
|
|
@ -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),
|
|
|
|
|