From 118e1c69057e4e7b6ab3e730d5628b4822ed4c4d Mon Sep 17 00:00:00 2001 From: xengineering Date: Tue, 15 Oct 2024 21:23:10 +0200 Subject: model: Save int-based schema version in DB Ceres v0.4.0 used the `git describe` output as database schema and enforced exactly matching versions between the database and the executable. This turned out to be not flexible enough. It is way easier to version the database separately with a simple integer and require the same database schema version integer between the application and the database. This commit implements this new approach. --- model/migrations/migration001.sql | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 model/migrations/migration001.sql (limited to 'model/migrations/migration001.sql') diff --git a/model/migrations/migration001.sql b/model/migrations/migration001.sql deleted file mode 100644 index 46f9fc6..0000000 --- a/model/migrations/migration001.sql +++ /dev/null @@ -1,29 +0,0 @@ -PRAGMA foreign_keys = ON; - -CREATE TABLE recipes ( - id INTEGER PRIMARY KEY, - title TEXT NOT NULL, - portions INTEGER NOT NULL, - url TEXT NOT NULL, - notes TEXT NOT NULL, - created INTEGER NOT NULL, -- Unix time stamp - last_changed INTEGER NOT NULL -- Unix time stamp -); - -CREATE TABLE steps ( - id INTEGER PRIMARY KEY, - 'index' INTEGER NOT NULL, - text TEXT NOT NULL, - recipe INTEGER NOT NULL, - FOREIGN KEY(recipe) REFERENCES recipes(id) -); - -CREATE TABLE ingredients ( - id INTEGER PRIMARY KEY, - 'index' INTEGER NOT NULL, - amount REAL NOT NULL, - unit TEXT NOT NULL, - 'type' TEXT NOT NULL, - step INTEGER NOT NULL, - FOREIGN KEY(step) REFERENCES steps(id) -); -- cgit v1.2.3-70-g09d2