MCPcopy Create free account
hub / github.com/cloudquery/cloudquery / canAutoMigrate

Method canAutoMigrate

plugins/destination/duckdb/client/migrate.go:82–100  ·  view source on GitHub ↗
(changes []schema.TableColumnChange)

Source from the content-addressed store, hash-verified

80}
81
82func (*Client) canAutoMigrate(changes []schema.TableColumnChange) bool {
83 for _, change := range changes {
84 if change.Type == schema.TableColumnChangeTypeAdd && (change.Current.PrimaryKey || change.Current.NotNull) {
85 return false
86 }
87
88 if change.Type == schema.TableColumnChangeTypeRemove && (change.Previous.PrimaryKey || change.Previous.NotNull) {
89 return false
90 }
91
92 if change.Type == schema.TableColumnChangeTypeUpdate {
93 return false
94 }
95 if change.Type == schema.TableColumnChangeTypeRemoveUniqueConstraint {
96 return false
97 }
98 }
99 return true
100}
101
102// Migrate migrates to the latest schema
103func (c *Client) MigrateTables(ctx context.Context, msgs message.WriteMigrateTables) error {

Callers 2

MigrateTablesMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected