runMigrations no longer adapts portable SQL (INTEGER→BIGINT, datetime('now')); fresh databases diverge from production
What happens
Since 0.177.0 ("Standardize framework persistence on PostgreSQL"), runMigrations runs migration SQL verbatim. Before, adaptSqlForPostgres rewrote every string migration on Postgres: INTEGER → BIGINT, datetime('now') → CURRENT_TIMESTAMP, dropped AUTOINCREMENT.
An app that wrote its migrations in the portable subset the docs recommended now gets a different schema on a fresh database than production has:
- epoch-millisecond columns declared
INTEGERbecomeint4and overflow on the first insert (value "1790000000000" is out of range for type integer); DEFAULT (datetime('now'))fails outright on a fresh database (local PGlite, a new preview, a test).
Existing production databases are unaffected (migrations are tracked by name and never re-run), which is what makes it easy to miss: it surfaces only on fresh databases.
The 0.177.0 changelog entry doesn't mention that the adapter is gone.
Suggestion
Either keep the rewrite for string migrations (dialect-specific { postgres } entries already bypass it), or call it out as a breaking change with the one-line app-side replacement. What we did, in the app's migration list:
const postgresMigrationSql = (sql: string) =>
sql
.replaceAll(/datetime\s*\(\s*'now'\s*\)/giu, "CURRENT_TIMESTAMP")
.replaceAll(/\bAUTOINCREMENT\b/giu, "")
.replaceAll(/\bINTEGER\b/giu, "BIGINT");
Tracked in #5743.
Thanks for the report. PostgreSQL migration guidance is in review at https://github.com/BuilderIO/agent-native/pull/8788; the reported incident and documentation still need verification.
Thanks for the report - this is fixed by https://github.com/BuilderIO/agent-native/pull/8788, which is merged and will be on beta shortly.