From 19b6b05b69b27524d2f7c3df4cc63fcf282001f6 Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Sun, 5 May 2024 10:44:28 +0200 Subject: [PATCH] Dropping entire database every migration --- app/Migrations/create-schema.sql | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/Migrations/create-schema.sql b/app/Migrations/create-schema.sql index a5c85a1..b0aee90 100644 --- a/app/Migrations/create-schema.sql +++ b/app/Migrations/create-schema.sql @@ -1,3 +1,13 @@ +PRAGMA foreign_keys = OFF; + +-- Drop everything... +DROP TABLE IF EXISTS pallets; +DROP TABLE IF EXISTS raw_materials_deliveries; +DROP TABLE IF EXISTS raw_materials; +DROP TABLE IF EXISTS orders; +DROP TABLE IF EXISTS customers; +DROP TABLE IF EXISTS cookies; + -------------------------------------------- -- Recipe/Cookie related tables -------------------------------------------- @@ -63,3 +73,5 @@ CREATE TABLE IF NOT EXISTS pallets ( FOREIGN KEY (cookie_id) REFERENCES cookies(cookie_id) -- FOREIGN KEY (order_id) REFERENCES orders(order_id) ); + +PRAGMA foreign_keys = ON; \ No newline at end of file