From 2d032044f9aa7250a3b69678a4ddbfe7048688ef Mon Sep 17 00:00:00 2001 From: ziggie Date: Mon, 25 Aug 2025 16:44:31 +0200 Subject: [PATCH] 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. --- sqldb/postgres.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sqldb/postgres.go b/sqldb/postgres.go index 8cfd3e25b..70dba82a1 100644 --- a/sqldb/postgres.go +++ b/sqldb/postgres.go @@ -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.