mirror of
https://github.com/StefBuwalda/cal_counter.git
synced 2025-10-30 11:19:59 +00:00
Introduces a new boolean column 'must_change_password' to the User model and database schema. This field enforces password change requirements for users and is included in the model's constructor and migration.
41 lines
933 B
Python
41 lines
933 B
Python
"""empty message
|
|
|
|
Revision ID: 101002a6ef17
|
|
Revises: dea130d45cec
|
|
Create Date: 2025-08-11 17:16:34.617851
|
|
|
|
"""
|
|
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = "101002a6ef17"
|
|
down_revision = "dea130d45cec"
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
with op.batch_alter_table("user", schema=None) as batch_op:
|
|
batch_op.add_column(
|
|
sa.Column(
|
|
"must_change_password",
|
|
sa.Boolean(),
|
|
nullable=False,
|
|
server_default="1",
|
|
)
|
|
)
|
|
|
|
# ### end Alembic commands ###
|
|
|
|
|
|
def downgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
with op.batch_alter_table("user", schema=None) as batch_op:
|
|
batch_op.drop_column("must_change_password")
|
|
|
|
# ### end Alembic commands ###
|