-
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.
fix: migration and add column religion
Co-Authored-by: Victor Amaral <[email protected]> Co-authored-by: Carlos Eduardo Mota Alves <[email protected]>
- Loading branch information
1 parent
2e0da39
commit 27d8060
Showing
3 changed files
with
61 additions
and
9 deletions.
There are no files selected for viewing
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
27 changes: 27 additions & 0 deletions
27
gestao/db/migrations/versions/2023-11-30-00-45_0f1bbda43a2b.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,27 @@ | ||
"""add: religion field | ||
Revision ID: 0f1bbda43a2b | ||
Revises: d304dbbb6ffe | ||
Create Date: 2023-11-30 00:45:51.838752 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = '0f1bbda43a2b' | ||
down_revision = 'd304dbbb6ffe' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade() -> None: | ||
with op.batch_alter_table("user") as batch_op: | ||
batch_op.add_column( | ||
sa.Column("religion", sa.String(200), nullable=True), | ||
) | ||
|
||
|
||
def downgrade() -> None: | ||
pass |
28 changes: 28 additions & 0 deletions
28
gestao/db/migrations/versions/2023-11-30-00-52_284b19912274.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 @@ | ||
"""add: religion field | ||
Revision ID: 284b19912274 | ||
Revises: 0f1bbda43a2b | ||
Create Date: 2023-11-30 00:52:32.940950 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = '284b19912274' | ||
down_revision = '0f1bbda43a2b' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade() -> None: | ||
with op.batch_alter_table("user") as batch_op: | ||
batch_op.add_column( | ||
sa.Column("religion", sa.String(200), nullable=True), | ||
) | ||
|
||
|
||
def downgrade() -> None: | ||
with op.batch_alter_table("user") as batch_op: | ||
batch_op.drop_column("religion") |