Commit b987c921 by Alexander Makarov

Escaped more table names

parent 538a074c
...@@ -44,19 +44,19 @@ CREATE TABLE "category" ( ...@@ -44,19 +44,19 @@ CREATE TABLE "category" (
CREATE TABLE "item" ( CREATE TABLE "item" (
id serial not null primary key, id serial not null primary key,
name varchar(128) NOT NULL, name varchar(128) NOT NULL,
category_id integer NOT NULL references category(id) on UPDATE CASCADE on DELETE CASCADE category_id integer NOT NULL references "category"(id) on UPDATE CASCADE on DELETE CASCADE
); );
CREATE TABLE "order" ( CREATE TABLE "order" (
id serial not null primary key, id serial not null primary key,
customer_id integer NOT NULL references customer(id) on UPDATE CASCADE on DELETE CASCADE, customer_id integer NOT NULL references "customer"(id) on UPDATE CASCADE on DELETE CASCADE,
created_at integer NOT NULL, created_at integer NOT NULL,
total decimal(10,0) NOT NULL total decimal(10,0) NOT NULL
); );
CREATE TABLE "order_item" ( CREATE TABLE "order_item" (
order_id integer NOT NULL references order(id) on UPDATE CASCADE on DELETE CASCADE, order_id integer NOT NULL references "order"(id) on UPDATE CASCADE on DELETE CASCADE,
item_id integer NOT NULL references item(id) on UPDATE CASCADE on DELETE CASCADE, item_id integer NOT NULL references "item"(id) on UPDATE CASCADE on DELETE CASCADE,
quantity integer NOT NULL, quantity integer NOT NULL,
subtotal decimal(10,0) NOT NULL, subtotal decimal(10,0) NOT NULL,
PRIMARY KEY (order_id,item_id) PRIMARY KEY (order_id,item_id)
......
...@@ -63,7 +63,7 @@ CREATE TABLE "composite_fk" ( ...@@ -63,7 +63,7 @@ CREATE TABLE "composite_fk" (
order_id int(11) NOT NULL, order_id int(11) NOT NULL,
item_id int(11) NOT NULL, item_id int(11) NOT NULL,
PRIMARY KEY (id), PRIMARY KEY (id),
CONSTRAINT FK_composite_fk_order_item FOREIGN KEY (order_id, item_id) REFERENCES order_item (order_id, item_id) ON DELETE CASCADE CONSTRAINT FK_composite_fk_order_item FOREIGN KEY (order_id, item_id) REFERENCES "order_item" (order_id, item_id) ON DELETE CASCADE
); );
CREATE TABLE "null_values" ( CREATE TABLE "null_values" (
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment