Added announcement support and list migrations.
This commit is contained in:
parent
5e0963042f
commit
c85a59d2ad
4 changed files with 52 additions and 9 deletions
|
|
@ -11,6 +11,7 @@ import (
|
|||
"go.destrealm.net/embedder"
|
||||
"go.destrealm.net/errors"
|
||||
"go.destrealm.net/logging/v3"
|
||||
"go.destrealm.net/migratory"
|
||||
"go.destrealm.net/vfs"
|
||||
)
|
||||
|
||||
|
|
@ -52,3 +53,21 @@ func (inst *installer) DoInstall(ctx context.Context, cmd *cli.Command) error {
|
|||
func (inst *installer) DoUp(ctx context.Context, cmd *cli.Command) error {
|
||||
return inst.DoInstall(ctx, cmd)
|
||||
}
|
||||
|
||||
func (inst *installer) ListMigrations(ctx context.Context, cmd *cli.Command) error {
|
||||
mg, err := migratory.New(inst.settings.System.DSN)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
mg.UsingVFS(inst.fs)
|
||||
migrator, err := mg.Migrate("migrations/sqlite")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for _, m := range migrator.Migrations() {
|
||||
fmt.Println(m)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue