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

Method canAutoMigrate

plugins/destination/sqlite/client/migrate.go:111–129  ·  view source on GitHub ↗
(changes []schema.TableColumnChange)

Source from the content-addressed store, hash-verified

109}
110
111func (*Client) canAutoMigrate(changes []schema.TableColumnChange) bool {
112 for _, change := range changes {
113 switch change.Type {
114 case schema.TableColumnChangeTypeAdd:
115 if change.Current.PrimaryKey || change.Current.NotNull {
116 return false
117 }
118 case schema.TableColumnChangeTypeRemove:
119 if change.Previous.PrimaryKey || change.Previous.NotNull {
120 return false
121 }
122 case schema.TableColumnChangeTypeRemoveUniqueConstraint:
123 continue
124 default:
125 return false
126 }
127 }
128 return true
129}
130
131// This is the responsibility of the CLI of the client to lock before running migration
132func (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