-
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.
- Loading branch information
Eduard0803
committed
Nov 2, 2023
1 parent
aef3d41
commit 14a0d4b
Showing
4 changed files
with
59 additions
and
4 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
gestao/db/migrations/versions/2023-11-02-16-33_e8a3e8746d3e.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,29 @@ | ||
"""rename column user.mother_date to user.mother_name and add column user.password | ||
Revision ID: e8a3e8746d3e | ||
Revises: 0084e7dffc7c | ||
Create Date: 2023-11-02 16:33:58.855003 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = 'e8a3e8746d3e' | ||
down_revision = '0084e7dffc7c' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade() -> None: | ||
op.alter_column("user", "mother_date", new_column_name="mother_name", type_=sa.String(length=200)) | ||
with op.batch_alter_table("user") as batch_op: | ||
batch_op.add_column( | ||
sa.Column("password", sa.String(200), nullable=True), | ||
) | ||
|
||
def downgrade() -> None: | ||
op.alter_column("user", "mother_name", new_column_name="mother_date", type_=sa.String(length=200)) | ||
with op.batch_alter_table("user") as batch_op: | ||
batch_op.drop_column("password") |
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