From abad64c808bf9bbc1f07583d014bcb88cad8a0b9 Mon Sep 17 00:00:00 2001 From: Michael Quigley Date: Fri, 29 Jul 2022 11:10:39 -0400 Subject: [PATCH] set migrations table name --- controller/store/sql/000_base.sql | 12 ++++++++++++ controller/store/store.go | 1 + 2 files changed, 13 insertions(+) diff --git a/controller/store/sql/000_base.sql b/controller/store/sql/000_base.sql index 699109be..9aa7569e 100644 --- a/controller/store/sql/000_base.sql +++ b/controller/store/sql/000_base.sql @@ -15,3 +15,15 @@ create table accounts ( constraint chk_password check (username <> ''), constraint chk_token check(token <> '') ); + +-- +-- services +-- +create table services ( + id integer primary key, + name string not null unique, + created_at datetime not null default(strftime('%Y-%m-%d %H:%M:%f', 'now')), + updated_at datetime not null default(strftime('%Y-%m-%d %H:%M:%f', 'now')), + + constraint chk_name check (name <> '') +); \ No newline at end of file diff --git a/controller/store/store.go b/controller/store/store.go index f471a7a5..5285d956 100644 --- a/controller/store/store.go +++ b/controller/store/store.go @@ -54,6 +54,7 @@ func (self *Store) migrate() error { FileSystem: sql.Fs, Root: "/", } + migrate.SetTable("migrations") n, err := migrate.Exec(self.db.DB, "sqlite3", migrations, migrate.Up) if err != nil { return errors.Wrap(err, "error running migrations")