Skip to content

Instantly share code, notes, and snippets.

@ruchej
Last active September 2, 2022 06:18
Show Gist options
  • Save ruchej/6c15b14ecaab990b5444e1aa27d4915a to your computer and use it in GitHub Desktop.
Save ruchej/6c15b14ecaab990b5444e1aa27d4915a to your computer and use it in GitHub Desktop.
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('advice_reactions', 'advice_id', new_column_name='advice_reсomendation_id')
op.drop_constraint('advice_reactions_advice_id_fkey', 'advice_reactions', type_='foreignkey')
op.create_foreign_key(None, 'advice_reactions', 'advices', ['advice_reсomendation_id'], ['id'], onupdate='CASCADE', ondelete='CASCADE')
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('advice_reactions', 'advice_reсomendation_id', new_column_name='advice_id')
op.drop_constraint(None, 'advice_reactions', type_='foreignkey')
op.create_foreign_key('advice_reactions_advice_id_fkey', 'advice_reactions', 'advices', ['advice_id'], ['id'], onupdate='CASCADE', ondelete='CASCADE')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment