You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit fbbd6df
Browse filesBrowse the repository at this point in the historyBrowse files
fix(db): push the schema before the Project migration reads it
The bootstrap ran 0032_project_membership before Drizzle pushed anything, so a
development database from before a column the migration reads (such as the
fork parent) failed after committing the expansion, on every retry.
--prepare now only replays the expansion. push.ts then runs one Drizzle push
with workspace.project_id still nullable (SIM_DB_PUSH_PROJECT_BOOTSTRAP=1),
runs the migration through reconcile-project-membership.ts --bootstrap, and
finishes with the ordinary push. The connector and rollout marker are kept out
of Drizzle's diff until the migration retires them. A fresh bootstrap also
requires that no public table carries a project_id column.
'Existing Project databases must complete the Project script migration 0032_project_membership before schema push. Use the phased migration path for retained data; schema push cannot bypass the writer-drain requirement'
17
+
15
18
interfaceProjectSchemaState{
16
19
workspace: boolean
17
20
project: boolean
@@ -20,6 +23,8 @@ interface ProjectSchemaState {
20
23
journal: boolean
21
24
/** Null when `workspace.project_id` does not exist; otherwise whether it is NOT NULL. */
22
25
projectIdNotNull: boolean|null
26
+
/** Whether any public table carries a `project_id` column. */
'Existing Project databases must complete the Project script migration 0032_project_membership before schema push. Use the phased migration path for retained data; schema push cannot bypass the writer-drain requirement'
108
-
)
109
-
}
110
-
if(!prepare&&state.workspace&&state.project){
111
-
/** Drizzle cannot express deferred FK timing; fresh push shares the migration finalizer. */
112
-
awaitenforceProjectMembership(sql)
113
-
logger.info('Project membership validation and native constraints completed')
0 commit comments