Delete SQL

This commit is contained in:
Tobe O 2018-05-03 23:52:39 -04:00
parent 856dfb9a92
commit db6de4bd8a
22 changed files with 0 additions and 101 deletions

View file

@ -1 +0,0 @@
DROP TABLE "authors";

View file

@ -1,8 +0,0 @@
CREATE TEMPORARY TABLE "authors" (
"id" serial,
"name" varchar UNIQUE,
"created_at" timestamp,
"updated_at" timestamp,
UNIQUE(name),
PRIMARY KEY(id)
);

View file

@ -1 +0,0 @@
DROP TABLE "books";

View file

@ -1,8 +0,0 @@
CREATE TEMPORARY TABLE "books" (
"id" serial,
"name" varchar,
"created_at" timestamp,
"updated_at" timestamp,
"author_id" int REFERENCES authors(id) ON DELETE CASCADE,
PRIMARY KEY(id)
);

View file

@ -1 +0,0 @@
DROP TABLE "cars";

View file

@ -1,10 +0,0 @@
CREATE TEMPORARY TABLE "cars" (
"id" serial,
"make" varchar,
"description" varchar,
"family_friendly" boolean,
"recalled_at" timestamp,
"created_at" timestamp,
"updated_at" timestamp,
PRIMARY KEY(id)
);

View file

@ -1 +0,0 @@
DROP TABLE "customers";

View file

@ -1,6 +0,0 @@
CREATE TEMPORARY TABLE "customers" (
"id" serial,
"created_at" timestamp,
"updated_at" timestamp,
PRIMARY KEY(id)
);

View file

@ -1 +0,0 @@
DROP TABLE "foots";

View file

@ -1,8 +0,0 @@
CREATE TEMPORARY TABLE "foots" (
"id" serial,
"leg_id" int,
"n_toes" int,
"created_at" timestamp,
"updated_at" timestamp,
PRIMARY KEY(id)
);

View file

@ -1 +0,0 @@
DROP TABLE "fruits";

View file

@ -1,8 +0,0 @@
CREATE TEMPORARY TABLE "fruits" (
"id" serial,
"tree_id" int,
"common_name" varchar,
"created_at" timestamp,
"updated_at" timestamp,
PRIMARY KEY(id)
);

View file

@ -1 +0,0 @@
DROP TABLE "legs";

View file

@ -1,7 +0,0 @@
CREATE TEMPORARY TABLE "legs" (
"id" serial,
"name" varchar,
"created_at" timestamp,
"updated_at" timestamp,
PRIMARY KEY(id)
);

View file

@ -1 +0,0 @@
DROP TABLE "orders";

View file

@ -1,10 +0,0 @@
CREATE TEMPORARY TABLE "orders" (
"id" serial,
"customer_id" int,
"employee_id" int,
"order_date" timestamp,
"shipper_id" int,
"created_at" timestamp,
"updated_at" timestamp,
PRIMARY KEY(id)
);

View file

@ -1 +0,0 @@
DROP TABLE "roles";

View file

@ -1,7 +0,0 @@
CREATE TEMPORARY TABLE "roles" (
"id" serial,
"name" varchar,
"created_at" timestamp,
"updated_at" timestamp,
PRIMARY KEY(id)
);

View file

@ -1 +0,0 @@
DROP TABLE "trees";

View file

@ -1,8 +0,0 @@
CREATE TEMPORARY TABLE "trees" (
"id" serial,
"rings" smallint UNIQUE,
"created_at" timestamp,
"updated_at" timestamp,
UNIQUE(rings),
PRIMARY KEY(id)
);

View file

@ -1 +0,0 @@
DROP TABLE "users";

View file

@ -1,10 +0,0 @@
CREATE TEMPORARY TABLE "users" (
"id" serial,
"username" varchar,
"password" varchar,
"email" varchar,
"created_at" timestamp,
"updated_at" timestamp,
"role_id" int REFERENCES roles(id),
PRIMARY KEY(id)
);