mirror of
https://git.sr.ht/~tsileo/microblog.pub
synced 2024-12-22 05:04:27 +00:00
Fix latest migration
This commit is contained in:
parent
dedeac994f
commit
4a6e203d23
1 changed files with 34 additions and 0 deletions
34
alembic/versions/8ae9fc9ac88c_webmention_notifications.py
Normal file
34
alembic/versions/8ae9fc9ac88c_webmention_notifications.py
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
"""Webmention notifications
|
||||||
|
|
||||||
|
Revision ID: 8ae9fc9ac88c
|
||||||
|
Revises: 2b51ae7047cb
|
||||||
|
Create Date: 2022-07-19 21:09:04.786032
|
||||||
|
|
||||||
|
"""
|
||||||
|
import sqlalchemy as sa
|
||||||
|
|
||||||
|
from alembic import op
|
||||||
|
|
||||||
|
# revision identifiers, used by Alembic.
|
||||||
|
revision = '8ae9fc9ac88c'
|
||||||
|
down_revision = '2b51ae7047cb'
|
||||||
|
branch_labels = None
|
||||||
|
depends_on = None
|
||||||
|
|
||||||
|
|
||||||
|
def upgrade() -> None:
|
||||||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||||||
|
with op.batch_alter_table('notifications', schema=None) as batch_op:
|
||||||
|
batch_op.add_column(sa.Column('webmention_id', sa.Integer(), nullable=True))
|
||||||
|
batch_op.create_foreign_key('fk_webmention_id', 'webmention', ['webmention_id'], ['id'])
|
||||||
|
|
||||||
|
# ### end Alembic commands ###
|
||||||
|
|
||||||
|
|
||||||
|
def downgrade() -> None:
|
||||||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||||||
|
with op.batch_alter_table('notifications', schema=None) as batch_op:
|
||||||
|
batch_op.drop_constraint('fk_webmention_id', type_='foreignkey')
|
||||||
|
batch_op.drop_column('webmention_id')
|
||||||
|
|
||||||
|
# ### end Alembic commands ###
|
Loading…
Reference in a new issue