Skip to content

Commit

Permalink
fix: migration and add column religion
Browse files Browse the repository at this point in the history
Co-Authored-by: Victor Amaral <[email protected]>
Co-authored-by: Carlos Eduardo Mota Alves <[email protected]>
  • Loading branch information
3 people committed Nov 30, 2023
1 parent 2e0da39 commit 27d8060
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 9 deletions.
15 changes: 6 additions & 9 deletions gestao/db/migrations/versions/2023-11-29-23-43_d304dbbb6ffe.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ def upgrade():
batch_op.add_column(
sa.Column("civilState", sa.String(100), nullable=True),
)
batch_op.add_column(
sa.Column("civilState", sa.String(100), nullable=True),
)
batch_op.add_column(
sa.Column("cep", sa.String(100), nullable=True),
)
Expand Down Expand Up @@ -73,22 +70,22 @@ def upgrade():
sa.Column("admissionDate", sa.Date()),
)
batch_op.add_column(
sa.Column("jobRole", sa.string(200), nullable=True),
sa.Column("jobRole", sa.String(200), nullable=True),
)
batch_op.add_column(
sa.Column("bodyOfLaw", sa.string(200)),
sa.Column("bodyOfLaw", sa.String(200)),
)
batch_op.add_column(
sa.Column("lotation", sa.string(200), nullable=True),
sa.Column("lotation", sa.String(200), nullable=True),
)
batch_op.add_column(
sa.Column("workPost", sa.string(200), nullable=True),
sa.Column("workPost", sa.String(200), nullable=True),
)
batch_op.add_column(
sa.Column("systemRole", sa.string(200), nullable=True),
sa.Column("systemRole", sa.String(200), nullable=True),
)
batch_op.add_column(
sa.Column("password", sa.string(200), nullable=True),
sa.Column("password", sa.String(200), nullable=True),
)


Expand Down
27 changes: 27 additions & 0 deletions gestao/db/migrations/versions/2023-11-30-00-45_0f1bbda43a2b.py
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 gestao/db/migrations/versions/2023-11-30-00-52_284b19912274.py
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")

0 comments on commit 27d8060

Please sign in to comment.