From c4d7859bc41d0ab7adc21f47641fb6289563ea5c Mon Sep 17 00:00:00 2001 From: Stefano Da Ros Date: Thu, 28 Mar 2019 16:35:32 +0100 Subject: [PATCH] Update sqlite3 migration script to match new data model --- build/migrate-to-sqlite.sh | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/build/migrate-to-sqlite.sh b/build/migrate-to-sqlite.sh index 05bd8c7..bace1a7 100755 --- a/build/migrate-to-sqlite.sh +++ b/build/migrate-to-sqlite.sh @@ -2,11 +2,27 @@ cat << __EOF__ | sqlite3 test.db BEGIN; -DROP TABLE IF EXISTS equipment; -DROP TABLE IF EXISTS ingredients; +DROP TABLE IF EXISTS zero_rows; +DROP TABLE IF EXISTS one_rows; +DROP TABLE IF EXISTS ingredient_recipe; DROP TABLE IF EXISTS inventory; +DROP TABLE IF EXISTS ingredients; DROP TABLE IF EXISTS recipes; -DROP TABLE IF EXISTS ingredient_recipe; +DROP TABLE IF EXISTS equipment; + + +CREATE TABLE IF NOT EXISTS zero_rows ( + id integer primary key autoincrement, + name text +); + +CREATE TABLE IF NOT EXISTS one_rows ( + id integer primary key autoincrement, + name text +); +INSERT INTO 'one_rows' ('name') + VALUES + ('TESTNAME'); CREATE TABLE IF NOT EXISTS equipment ( id integer primary key autoincrement,