-
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.
Merge pull request #8 from fga-eps-mds/feat/user-dependents-fix
Adiciona novos campos de user/dependent e rota de desabilitar filiado
- Loading branch information
Showing
13 changed files
with
138 additions
and
187 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
35 changes: 35 additions & 0 deletions
35
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,35 @@ | ||
"""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), | ||
) | ||
batch_op.add_column( | ||
sa.Column("status", sa.String(200), default="active"), | ||
) | ||
|
||
|
||
def downgrade(): | ||
with op.batch_alter_table("user") as batch_op: | ||
batch_op.drop_column("workstation") | ||
batch_op.drop_column("nickname") | ||
batch_op.drop_column("status") |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from enum import Enum | ||
|
||
|
||
class UserStatus(str, Enum): | ||
active = "active" | ||
inactive = "inactive" |
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
Oops, something went wrong.