mirror of
https://github.com/dolthub/dolt.git
synced 2026-02-05 10:31:30 -06:00
limit schema patching to dolt system tables only
This commit is contained in:
@@ -16,7 +16,6 @@ package migrate
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/dolthub/dolt/go/libraries/doltcore/ref"
|
||||
|
||||
"github.com/dolthub/dolt/go/libraries/doltcore/doltdb"
|
||||
@@ -189,7 +188,7 @@ func migrateRoot(ctx context.Context, root *doltdb.RootValue, new *doltdb.DoltDB
|
||||
}
|
||||
|
||||
err = root.IterTables(ctx, func(name string, tbl *doltdb.Table, _ schema.Schema) (bool, error) {
|
||||
mtbl, err := migrateTable(ctx, tbl, new)
|
||||
mtbl, err := migrateTable(ctx, name, tbl, new)
|
||||
if err != nil {
|
||||
return true, err
|
||||
}
|
||||
@@ -211,7 +210,7 @@ func migrateRoot(ctx context.Context, root *doltdb.RootValue, new *doltdb.DoltDB
|
||||
return migrated, nil
|
||||
}
|
||||
|
||||
func migrateTable(ctx context.Context, table *doltdb.Table, new *doltdb.DoltDB) (*doltdb.Table, error) {
|
||||
func migrateTable(ctx context.Context, name string, table *doltdb.Table, new *doltdb.DoltDB) (*doltdb.Table, error) {
|
||||
rows, err := table.GetRowData(ctx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -232,9 +231,14 @@ func migrateTable(ctx context.Context, table *doltdb.Table, new *doltdb.DoltDB)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if sch, err = patchMigrateSchema(ctx, sch); err != nil {
|
||||
return nil, err
|
||||
|
||||
// maybe patch dolt_schemas, dolt docs
|
||||
if doltdb.HasDoltPrefix(name) {
|
||||
if sch, err = patchMigrateSchema(ctx, sch); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
if err = validateSchema(sch); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user