-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e43cc92
commit a0832d4
Showing
2 changed files
with
30 additions
and
2 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
backend/app/alembic/versions/09d011c1b387_zones_can_be_null.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
"""zones_can_be_null | ||
Revision ID: 09d011c1b387 | ||
Revises: 8437ce954087 | ||
Create Date: 2024-09-09 13:34:59.347083 | ||
""" | ||
|
||
from typing import Sequence, Union | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision: str = "09d011c1b387" | ||
down_revision: Union[str, None] = "8437ce954087" | ||
branch_labels: Union[str, Sequence[str], None] = None | ||
depends_on: Union[str, Sequence[str], None] = None | ||
|
||
|
||
def upgrade() -> None: | ||
op.execute(sa.text("ALTER TABLE document.assignments ALTER zone DROP NOT NULL")) | ||
|
||
|
||
def downgrade() -> None: | ||
op.execute(sa.text("DELETE FROM document.assignments WHERE zone IS NULL")) | ||
op.execute(sa.text("ALTER TABLE document.assignments ALTER zone SET NOT NULL")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters