text: """Added ondelete behavior for payments and reservateions
  
  Revision ID: ec9949ec8d8e
  Revises: 930b8323ddfd
  Create Date: 2022-03-24 15:17:41.329724
  
  """
  from alembic import op
  import sqlalchemy as sa
  
  
  # revision identifiers, used by Alembic.
  revision = 'ec9949ec8d8e'
  down_revision = '930b8323ddfd'
  branch_labels = None
  depends_on = None
  
  
  def upgrade():
      # ### commands auto generated by Alembic - please adjust! ###
      op.drop_constraint('payments_user_id_fkey', 'payments', type_='foreignkey')
      op.create_foreign_key(None, 'payments', 'users', ['user_id'], ['id'], ondelete='CASCADE')
      op.drop_constraint('reservations_user_id_fkey', 'reservations', type_='foreignkey')
      op.create_foreign_key(None, 'reservations', 'users', ['user_id'], ['id'], ondelete='CASCADE')
      # ### end Alembic commands ###
  
  
  def downgrade():
      # ### commands auto generated by Alembic - please adjust! ###
      op.drop_constraint(None, 'reservations', type_='foreignkey')
      op.create_foreign_key('reservations_user_id_fkey', 'reservations', 'users', ['user_id'], ['id'])
      op.drop_constraint(None, 'payments', type_='foreignkey')
      op.create_foreign_key('payments_user_id_fkey', 'payments', 'users', ['user_id'], ['id'])
      # ### end Alembic commands ###
  