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
If you modify any enums used in SQLAlchemy models, you will need to set up PostgreSQL
17
-
in order to generate a PostgreSQL-specific enum migration.
16
+
The `dstack` server claims to support multi-replica setups with zero-downtime deployments.
17
+
This means DB migrations should not make changes that break old replicas.
18
+
Incompatible changes should be introduced in multiple stages (releases), following
19
+
the [expand and contract pattern](https://www.prisma.io/dataguide/types/relational/expand-and-contract-pattern).
18
20
19
-
1. Run PostgreSQL.
21
+
**Note**: If it's impossible to make the migration compatible with older versions, the PR should say so explicitly, so that the change is planned and released with the migration notice.
20
22
21
-
```shell
22
-
docker run --rm -p 5432:5432 -e POSTGRES_PASSWORD=password postgres
23
-
```
23
+
Below are some common changes and how to make them.
Altering a table requires Postgres to [take an ACCESS EXCLUSIVE lock](https://www.postgresql.org/docs/current/sql-altertable.html). (This applies not only to statements that rewrite the tables but also to statements that modify tables metadata.) Altering multiple tables can cause deadlocks due to conflict with read operations since the `dstack` server does not define an order for read operations. Altering multiple tables should be done in separate transactions/migrations.
0 commit comments