-
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.
feat: add new fields to user and dependent
- Loading branch information
1 parent
c2fe2bc
commit b952e37
Showing
10 changed files
with
85 additions
and
149 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
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
31 changes: 31 additions & 0 deletions
31
gestao/db/migrations/versions/2023-10-28-21-20_05258d089f10.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,31 @@ | ||
"""add user workstation and nickname | ||
Revision ID: 05258d089f10 | ||
Revises: 532e4deb3c37 | ||
Create Date: 2023-10-28 21:20:43.696192 | ||
""" | ||
import sqlalchemy as sa | ||
from alembic import op | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "05258d089f10" | ||
down_revision = "532e4deb3c37" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
with op.batch_alter_table("user") as batch_op: | ||
batch_op.add_column( | ||
sa.Column("workstation", sa.String(200), nullable=True), | ||
) | ||
batch_op.add_column( | ||
sa.Column("nickname", sa.String(200), nullable=True), | ||
) | ||
|
||
|
||
def downgrade(): | ||
with op.batch_alter_table("user") as batch_op: | ||
batch_op.drop_column("workstation") | ||
batch_op.drop_column("nickname") |
39 changes: 39 additions & 0 deletions
39
gestao/db/migrations/versions/2023-10-28-21-23_0084e7dffc7c.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,39 @@ | ||
"""add dependent cof gender and pensioner | ||
Revision ID: 0084e7dffc7c | ||
Revises: 05258d089f10 | ||
Create Date: 2023-10-28 21:23:57.809923 | ||
""" | ||
import sqlalchemy as sa | ||
from alembic import op | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "0084e7dffc7c" | ||
down_revision = "05258d089f10" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
with op.batch_alter_table("dependent") as batch_op: | ||
batch_op.add_column( | ||
sa.Column("cpf", sa.String(200), nullable=True, unique=True), | ||
) | ||
batch_op.add_column( | ||
sa.Column("gender", sa.String(200), nullable=True), | ||
) | ||
batch_op.add_column( | ||
sa.Column("phone", sa.String(200), nullable=True), | ||
) | ||
batch_op.add_column( | ||
sa.Column("pensioner", sa.Boolean(), default=False), | ||
) | ||
|
||
|
||
def downgrade(): | ||
with op.batch_alter_table("dependent") as batch_op: | ||
batch_op.drop_column("cpf") | ||
batch_op.drop_column("gender") | ||
batch_op.drop_column("phone") | ||
batch_op.drop_column("pensioner") |
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