Commit 807d41e
authored
Internally Managed Migrations (#438)
This PR replaces Alembic-based system database migrations with a simpler
internal system.
Migrations are now an array of SQL strings in `_migration.py`. There is
a new table `dbos.dbos_migrations` in the system database that keeps
track of which has run. When initializing the system database, it looks
up that table to see which migrations have already run and then runs the
rest.
This new scheme is fully backwards-compatible with the old
(Alembic-based) migrations, as this PR also adds a final Alembic
migration that creates the `dbos.dbos_migrations` table and inserts an
initial version into it.
We will move all DBOS languages (TypeScript, Go, Java) to this system
and use exactly the same migrations for each to ensure system database
compatibility across languages.1 parent 231a336 commit 807d41e
File tree
23 files changed
+333
-100
lines changed- dbos
- _alembic_migrations
- versions
- tests
23 files changed
+333
-100
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | 89 | | |
101 | 90 | | |
102 | 91 | | |
| |||
This file was deleted.
File renamed without changes.
File renamed without changes.
Lines changed: 35 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
0 commit comments