dialect/sql/schema: add option to control symbol hashing logic for schema dump (#4411)

This commit is contained in:
Jannik Clausen
2025-07-10 09:32:25 +02:00
committed by GitHub
parent ace82484b8
commit 51e185459a
4 changed files with 167 additions and 96 deletions

View File

@@ -38,6 +38,7 @@ type Atlas struct {
dropColumns bool // drop deleted columns
dropIndexes bool // drop deleted indexes
withForeignKeys bool // with foreign keys
hashSymbols bool // whether to use a hash for too long symbols, only for StateReader
mode Mode
hooks []Hook // hooks to apply before creation
diffHooks []DiffHook // diff hooks to run when diffing current and desired
@@ -528,6 +529,9 @@ func (a *Atlas) StateReader(tables ...*Table) migrate.StateReaderFunc {
}
a.sqlDialect = drv
}
if a.hashSymbols {
a.setupTables(tables)
}
return a.realm(tables)
}
}