feat(writer): 🎉 Update index naming conventions for consistency
All checks were successful
CI / Test (1.24) (push) Successful in -26m25s
CI / Test (1.25) (push) Successful in -26m17s
CI / Lint (push) Successful in -26m32s
CI / Build (push) Successful in -26m42s
Release / Build and Release (push) Successful in -26m31s
Integration Tests / Integration Tests (push) Successful in -26m24s

* Use SQLName() for primary key constraint naming
* Enhance index name formatting with column suffix
This commit is contained in:
2026-01-31 17:23:18 +02:00
parent f532fc110c
commit 51ab29f8e3
2 changed files with 3 additions and 2 deletions

View File

@@ -594,7 +594,8 @@ func (w *Writer) writeIndexes(schema *models.Schema) error {
if index.Unique {
indexType = "uidx"
}
indexName = fmt.Sprintf("%s_%s_%s", indexType, schema.SQLName(), table.SQLName())
columnSuffix := strings.Join(index.Columns, "_")
indexName = fmt.Sprintf("%s_%s_%s", indexType, table.SQLName(), strings.ToLower(columnSuffix))
}
// Build column list with operator class support for GIN indexes