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. --- main.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'main.go') diff --git a/main.go b/main.go index f648a2d..1d7d3e1 100644 --- a/main.go +++ b/main.go @@ -36,7 +36,10 @@ func main() { db := model.OpenDB(filepath.Join(storage.Path, "ceres.sqlite3")) defer db.Close() - db.Migrate(version) + err := db.Migrate() + if err != nil { + log.Fatal(err) + } if flags.examples { db.CreateExamples() -- cgit v1.2.3-70-g09d2