Last active
September 2, 2022 06:18
-
-
Save ruchej/6c15b14ecaab990b5444e1aa27d4915a to your computer and use it in GitHub Desktop.
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
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