implement delete post
This commit is contained in:
parent
e47103d0ee
commit
0311586a1b
7 changed files with 98 additions and 3 deletions
34
alembic/versions/6d418df3c72f_.py
Normal file
34
alembic/versions/6d418df3c72f_.py
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
"""empty message
|
||||
|
||||
Revision ID: 6d418df3c72f
|
||||
Revises: 90c7d0098efe
|
||||
Create Date: 2025-07-07 13:37:51.667620
|
||||
|
||||
"""
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = '6d418df3c72f'
|
||||
down_revision: Union[str, None] = '90c7d0098efe'
|
||||
branch_labels: Union[str, Sequence[str], None] = None
|
||||
depends_on: Union[str, Sequence[str], None] = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
"""Upgrade schema."""
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_constraint('comment_parent_post_id_fkey', 'freak_comment', type_='foreignkey')
|
||||
op.create_foreign_key('comment_parent_post_id', 'freak_comment', 'freak_post', ['parent_post_id'], ['id'], ondelete='cascade')
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
"""Downgrade schema."""
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_constraint('comment_parent_post_id', 'freak_comment', type_='foreignkey')
|
||||
op.create_foreign_key('comment_parent_post_id_fkey', 'freak_comment', 'freak_post', ['parent_post_id'], ['id'])
|
||||
# ### end Alembic commands ###
|
||||
Loading…
Add table
Add a link
Reference in a new issue