Added announcement support and list migrations.
This commit is contained in:
parent
5e0963042f
commit
c85a59d2ad
4 changed files with 52 additions and 9 deletions
|
|
@ -18,3 +18,17 @@ func DoMigration(conf *settings.Settings) error {
|
|||
|
||||
return migrator.Up()
|
||||
}
|
||||
|
||||
func ListMigrations(conf *settings.Settings) ([]string, error) {
|
||||
mg, err := migratory.New(conf.System.DSN)
|
||||
if err != nil {
|
||||
return []string{}, err
|
||||
}
|
||||
mg.UsingVFS(conf.FS)
|
||||
migrator, err := mg.Migrate("migrations/sqlite")
|
||||
if err != nil {
|
||||
return []string{}, err
|
||||
}
|
||||
|
||||
return migrator.Migrations(), nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue