Skip to content

Commit

Permalink
Support not running DB migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
eandre committed Nov 6, 2023
1 parent 5550769 commit 895a99a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cli/daemon/sqldb/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,11 @@ func (db *DB) EnsureRoles(ctx context.Context, roles ...Role) error {

// Migrate migrates the database.
func (db *DB) Migrate(ctx context.Context, appRoot string, dbMeta *meta.SQLDatabase) (err error) {
if len(dbMeta.Migrations) == 0 {
db.log.Debug().Msg("no database migrations to run, skipping")
return nil
}

db.log.Debug().Msg("running database migrations")
defer func() {
if err != nil {
Expand Down

0 comments on commit 895a99a

Please sign in to comment.