summaryrefslogtreecommitdiff
path: root/model/sql/migration001.sql
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2024-10-15 21:23:10 +0200
committerxengineering <me@xengineering.eu>2024-10-21 21:34:26 +0200
commit118e1c69057e4e7b6ab3e730d5628b4822ed4c4d (patch)
tree0d4d49c29475715b932e780b976b1379c7aa23d3 /model/sql/migration001.sql
parent1904f50084660ce587a67d49939fd0734fd8a582 (diff)
downloadceres-118e1c69057e4e7b6ab3e730d5628b4822ed4c4d.tar
ceres-118e1c69057e4e7b6ab3e730d5628b4822ed4c4d.tar.zst
ceres-118e1c69057e4e7b6ab3e730d5628b4822ed4c4d.zip
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.
Diffstat (limited to 'model/sql/migration001.sql')
-rw-r--r--model/sql/migration001.sql8
1 files changed, 8 insertions, 0 deletions
diff --git a/model/sql/migration001.sql b/model/sql/migration001.sql
new file mode 100644
index 0000000..64c7ee3
--- /dev/null
+++ b/model/sql/migration001.sql
@@ -0,0 +1,8 @@
+-- Database schema 1 is the first schema with numerical versioning.
+
+DELETE FROM metadata WHERE key = 'version';
+
+INSERT INTO metadata
+ (key, value)
+VALUES
+ ('schema_version', '2');