-
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
1 parent
4315888
commit dc57e2a
Showing
2 changed files
with
34 additions
and
1 deletion.
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
34 changes: 34 additions & 0 deletions
34
backend/migrations/versions/5a9f9b3bdc20_remove_attn_to_column_from_log_records_.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,34 @@ | ||
"""remove attn_to column from log records table | ||
Revision ID: 5a9f9b3bdc20 | ||
Revises: 51ad56d133e9 | ||
Create Date: 2024-04-21 04:15:23.112342 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = '5a9f9b3bdc20' | ||
down_revision = '51ad56d133e9' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
with op.batch_alter_table('log_records', schema=None) as batch_op: | ||
batch_op.drop_constraint('log_records_attn_to_fkey', type_='foreignkey') | ||
batch_op.drop_column('attn_to') | ||
|
||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
with op.batch_alter_table('log_records', schema=None) as batch_op: | ||
batch_op.add_column(sa.Column('attn_to', sa.INTEGER(), autoincrement=False, nullable=True)) | ||
batch_op.create_foreign_key('log_records_attn_to_fkey', 'users', ['attn_to'], ['id']) | ||
|
||
# ### end Alembic commands ### |