diff --git a/app/db/migrations/versions/a83e4dd22672_refactor_user_expire.py b/app/db/migrations/versions/a83e4dd22672_refactor_user_expire.py index 0afe928..4c42b49 100644 --- a/app/db/migrations/versions/a83e4dd22672_refactor_user_expire.py +++ b/app/db/migrations/versions/a83e4dd22672_refactor_user_expire.py @@ -72,13 +72,22 @@ def upgrade() -> None: batch_op.drop_column(old) else: op.alter_column( - "users", "on_hold_timeout", new_column_name="activation_deadline" + "users", + "on_hold_timeout", + new_column_name="activation_deadline", + existing_type=sa.DateTime, + ) + op.alter_column( + "users", + "expire", + new_column_name="expire_date", + existing_type=sa.DateTime, ) - op.alter_column("users", "expire", new_column_name="expire_date") op.alter_column( "users", "on_hold_expire_duration", new_column_name="usage_duration", + existing_type=sa.BigInteger, ) # ### end Alembic commands ### users_table = table( @@ -130,12 +139,23 @@ def downgrade() -> None: ), ) op.alter_column( - "users", "activation_deadline", new_column_name="on_hold_timeout" + "users", + "activation_deadline", + new_column_name="on_hold_timeout", + existing_type=sa.DateTime, ) op.alter_column( - "users", "usage_duration", new_column_name="on_hold_expire_duration" + "users", + "usage_duration", + new_column_name="on_hold_expire_duration", + existing_type=sa.BigInteger, + ) + op.alter_column( + "users", + "expire_date", + new_column_name="expire", + existing_type=sa.DateTime, ) - op.alter_column("users", "expire_date", new_column_name="expire") op.drop_column("users", "expire_strategy") op.drop_column("users", "activated") # ### end Alembic commands ###