-
-
Notifications
You must be signed in to change notification settings - Fork 193
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
37f2eeb
commit 9ef3550
Showing
4 changed files
with
45 additions
and
1 deletion.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
source/app/alembic/versions/9e8744ca051b_add_case_close_datetime.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,36 @@ | ||
"""Add case close_datetime | ||
Revision ID: 9e8744ca051b | ||
Revises: 11aa5b725b8e | ||
Create Date: 2024-11-18 16:03:05.620518 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
from app.alembic.alembic_utils import _table_has_column | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = '9e8744ca051b' | ||
down_revision = 'd5a720d1b99b' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
op.execute('COMMIT') | ||
|
||
if not _table_has_column('cases', 'close_datetime'): | ||
op.add_column('cases', | ||
sa.Column('close_datetime', sa.DateTime, default=False), | ||
# insert_after requires alembic 1.10.0 or higher | ||
#insert_after = 'initial_date' | ||
) | ||
return | ||
|
||
|
||
def downgrade(): | ||
if _table_has_column('cases', 'close_datetime'): | ||
op.drop_column('cases', 'close_datetime') | ||
return |
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
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
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