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 committed 2025-09-05 09:52:41 +02:00
1 parent e20a34de46
commit 2d032044f9
1 file changed
+4 -1
+4 -1
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.