-
-
Notifications
You must be signed in to change notification settings - Fork 449
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: preserve user id on alias deleted (#2304)
- Loading branch information
1 parent
7f01dec
commit 31c8a76
Showing
4 changed files
with
40 additions
and
2 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
28 changes: 28 additions & 0 deletions
28
migrations/versions/2024_110610_4882cc49dde9_preserve_user_id_on_alias_delete.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,28 @@ | ||
"""Preserve user id on alias delete | ||
Revision ID: 4882cc49dde9 | ||
Revises: 32f25cbf12f6 | ||
Create Date: 2024-11-06 10:10:40.235991 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = '4882cc49dde9' | ||
down_revision = '32f25cbf12f6' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
op.add_column('deleted_alias', sa.Column('user_id', sa.Integer(), server_default=None, nullable=True)) | ||
with op.get_context().autocommit_block(): | ||
op.create_index('ix_deleted_alias_user_id_created_at', 'deleted_alias', ['user_id', 'created_at'], unique=False, postgresql_concurrently=True) | ||
|
||
|
||
def downgrade(): | ||
with op.get_context().autocommit_block(): | ||
op.drop_index('ix_deleted_alias_user_id_created_at', table_name='deleted_alias') | ||
op.drop_column('deleted_alias', 'user_id') |
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