From a633665f32101c2c2f44724e2aa95e4bc4158e6a Mon Sep 17 00:00:00 2001 From: Jeffrey Elkner Date: Thu, 27 Apr 2023 11:26:59 +0100 Subject: [PATCH] Make create script idempotent --- scripts/create_tables.sql | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/create_tables.sql b/scripts/create_tables.sql index c767e07..f2390c3 100644 --- a/scripts/create_tables.sql +++ b/scripts/create_tables.sql @@ -1,8 +1,8 @@ BEGIN TRANSACTION; -DROP TABLE IF EXISTS "author"; -DROP TABLE IF EXISTS "quote"; -DROP TABLE IF EXISTS "category"; -DROP TABLE IF EXISTS "quotecategory"; +DROP TABLE IF EXISTS "quotecategory" CASCADE; +DROP TABLE IF EXISTS "author" CASCADE; +DROP TABLE IF EXISTS "quote" CASCADE; +DROP TABLE IF EXISTS "category" CASCADE; CREATE TABLE author( aid SERIAL PRIMARY KEY, fname TEXT,