From cb8c66849ae6d2028680177daf7dbb32f2e43881 Mon Sep 17 00:00:00 2001 From: yankomissarov Date: Tue, 29 Oct 2024 12:48:33 +0300 Subject: [PATCH] Fix migration --- service/rqlite/goose_store/dialect.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/service/rqlite/goose_store/dialect.go b/service/rqlite/goose_store/dialect.go index 4f9e82d..c22952f 100644 --- a/service/rqlite/goose_store/dialect.go +++ b/service/rqlite/goose_store/dialect.go @@ -7,12 +7,12 @@ import ( type Rqlite struct{} func (s *Rqlite) CreateTable(tableName string) string { - q := `CREATE TABLE %s ( + q := `CREATE TABLE if not exists %s ( id INTEGER PRIMARY KEY AUTOINCREMENT, version_id INTEGER NOT NULL, is_applied INTEGER NOT NULL, tstamp DATETIME DEFAULT (datetime('now')) - ) if not exists` + )` return fmt.Sprintf(q, tableName) }