sqldb: Make sure we do not replace keywords if they have a prefix

We don't for example want to replace CURRENT_TIMESTAMP when using
it in our tables.
This commit is contained in:
ziggie
2025-08-25 16:44:31 +02:00
parent e20a34de46
commit 2d032044f9

View File

@@ -30,7 +30,10 @@ var (
postgresSchemaReplacements = map[string]string{
"BLOB": "BYTEA",
"INTEGER PRIMARY KEY": "BIGSERIAL PRIMARY KEY",
"TIMESTAMP": "TIMESTAMP WITHOUT TIME ZONE",
// We need this space in front of the TIMESTAMP keyword to
// avoid replacing words which just have the word "TIMESTAMP" in
// them.
" TIMESTAMP": " TIMESTAMP WITHOUT TIME ZONE",
}
// Make sure PostgresStore implements the MigrationExecutor interface.