fix(database): normalize baseline schema ddl

This commit is contained in:
ZacharyZhang-NY committed 2026-04-24 09:39:44 -04:00
1 parent 4582bdbee5
commit eabd304a45
2 files changed
+30 -4

No files matched your search

@@ -199,6 +199,8 @@ export function parseBaselineIndexName(sql: string): string {
export function normalizeSchemaSql(sql: string): string {
return sql
.replace(/\s+/g, " ")
.replace(/\(\s+/g, "(")
.replace(/\s+\)/g, ")")
.replace(/^CREATE TABLE "([^"]+)"/, "CREATE TABLE $1")
.replace(/^CREATE INDEX "([^"]+)"/, "CREATE INDEX $1")
.replace(/^CREATE UNIQUE INDEX "([^"]+)"/, "CREATE UNIQUE INDEX $1")