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
Copy file name to clipboardExpand all lines: README.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -152,14 +152,16 @@ On startup, the server does one of two things:
152
152
1. Fresh database:
153
153
It runs the embedded `.up.sql` files and creates both the application tables and `schema_migrations`.
154
154
2. Existing Bun-initialized database:
155
-
It detects that the full legacy application schema already exists, creates `schema_migrations` if needed, and records the latest embedded migration version without replaying those migrations.
155
+
It detects that the full legacy application schema already exists, creates `schema_migrations` if needed, and records the fixed Bun handoff version (`2`) without replaying those baseline migrations.
156
156
157
157
In this codebase, "reconcile" means that second path: we leave the existing application tables alone and only establish `schema_migrations` so `golang-migrate` can take over from that point forward.
158
158
159
+
That handoff version is intentionally hardcoded. If we add new `golang-migrate` migrations later that never existed in Bun, older deployments must still run them after upgrade rather than being incorrectly marked as already up to date.
160
+
159
161
Expected state after a successful startup:
160
162
161
163
- Fresh DB: application tables exist and `schema_migrations` contains the latest version.
162
-
- Bun-initialized DB: the same application tables still exist, `schema_migrations` now exists and contains the latest version, and `bun_migrations` may still exist but is no longer used by the server.
164
+
- Bun-initialized DB: the same application tables still exist, `schema_migrations` now exists and contains version`2`, and `bun_migrations` may still exist but is no longer used by the server.
0 commit comments