MCPcopy Create free account
hub / github.com/bytebase/bytebase / writeDropIndexDiff

Function writeDropIndexDiff

backend/plugin/schema/pg/metadata_migration.go:1350–1359  ·  view source on GitHub ↗
(out *strings.Builder, schemaName, tableName string, index *storepb.IndexMetadata)

Source from the content-addressed store, hash-verified

1348}
1349
1350func writeDropIndexDiff(out *strings.Builder, schemaName, tableName string, index *storepb.IndexMetadata) error {
1351 if index.GetIsConstraint() {
1352 return writeDropTableConstraint(out, schemaName, tableName, index.GetName())
1353 }
1354 if index.GetName() == "" {
1355 return nil
1356 }
1357 _, err := fmt.Fprintf(out, "DROP INDEX \"%s\".\"%s\";\n\n", schemaName, index.GetName())
1358 return err
1359}
1360
1361func writeAddCheckConstraint(out *strings.Builder, schemaName, tableName string, check *storepb.CheckConstraintMetadata) error {
1362 if check == nil {

Callers 1

Calls 3

writeDropTableConstraintFunction · 0.85
GetIsConstraintMethod · 0.45
GetNameMethod · 0.45

Tested by

no test coverage detected