Update to new goprogram version
This commit is contained in:
parent
7bd9570bc0
commit
873fdcd5c2
106 changed files with 478 additions and 825 deletions
|
|
@ -18,7 +18,7 @@ func (*SQL) BackupName() string {
|
|||
// Backup makes a backup of all SQL databases into the path dest.
|
||||
func (sql *SQL) Backup(scontext *component.StagingContext) error {
|
||||
return scontext.AddFile("", func(ctx context.Context, file io.Writer) error {
|
||||
code := sql.Stack().Exec(ctx, stream.NewIOStream(file, scontext.Progress(), nil, 0), "sql", SQlDumpExecutable, "--all-databases")()
|
||||
code := sql.Stack().Exec(ctx, stream.NewIOStream(file, scontext.Progress(), nil), "sql", SQlDumpExecutable, "--all-databases")()
|
||||
if code != 0 {
|
||||
return errSQLBackup
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ func (sql *SQL) Snapshot(wisski models.Instance, scontext *component.StagingCont
|
|||
|
||||
// SnapshotDB makes a backup of the sql database into dest.
|
||||
func (sql *SQL) SnapshotDB(ctx context.Context, progress io.Writer, dest io.Writer, database string) error {
|
||||
code := sql.Stack().Exec(ctx, stream.NewIOStream(dest, progress, nil, 0), "sql", SQlDumpExecutable, "--databases", database)()
|
||||
code := sql.Stack().Exec(ctx, stream.NewIOStream(dest, progress, nil), "sql", SQlDumpExecutable, "--databases", database)()
|
||||
if code != 0 {
|
||||
return errSQLBackup
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import (
|
|||
|
||||
type SQL struct {
|
||||
component.Base
|
||||
Dependencies struct {
|
||||
dependencies struct {
|
||||
Tables []component.Table
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ var (
|
|||
|
||||
func (*InstanceTable) TableInfo() component.TableInfo {
|
||||
return component.TableInfo{
|
||||
Model: reflectx.MakeType[models.Instance](),
|
||||
Model: reflectx.TypeFor[models.Instance](),
|
||||
Name: models.InstanceTable,
|
||||
}
|
||||
}
|
||||
|
|
@ -33,7 +33,7 @@ var (
|
|||
|
||||
func (*LockTable) TableInfo() component.TableInfo {
|
||||
return component.TableInfo{
|
||||
Model: reflectx.MakeType[models.Lock](),
|
||||
Model: reflectx.TypeFor[models.Lock](),
|
||||
Name: models.LockTable,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ func (sql *SQL) Update(ctx context.Context, progress io.Writer) error {
|
|||
|
||||
// migrate all of the tables!
|
||||
return logging.LogOperation(func() error {
|
||||
for _, table := range sql.Dependencies.Tables {
|
||||
for _, table := range sql.dependencies.Tables {
|
||||
info := table.TableInfo()
|
||||
logging.LogMessage(progress, "migrating %q table", table.Name())
|
||||
db, err := sql.queryTable(ctx, false, info.Name)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue