text: """update Ratings
  
  Revision ID: 066925d2e669
  Revises: 48cb99634644
  Create Date: 2021-01-20 10:12:48.319900
  
  """
  from alembic import op
  import sqlalchemy as sa
  
  
  # revision identifiers, used by Alembic.
  revision = '066925d2e669'
  down_revision = '48cb99634644'
  branch_labels = None
  depends_on = None
  
  
  def upgrade():
      # ### commands auto generated by Alembic - please adjust! ###
      with op.batch_alter_table('ratings', schema=None) as batch_op:
          batch_op.add_column(sa.Column('anime_name', sa.String(length=256), nullable=True))
          batch_op.drop_constraint('fk_ratings_anime_id_animes', type_='foreignkey')
          batch_op.create_foreign_key(batch_op.f('fk_ratings_anime_name_animes'), 'animes', ['anime_name'], ['name'])
          batch_op.drop_column('anime_id')
  
      # ### end Alembic commands ###
  
  
  def downgrade():
      # ### commands auto generated by Alembic - please adjust! ###
      with op.batch_alter_table('ratings', schema=None) as batch_op:
          batch_op.add_column(sa.Column('anime_id', sa.INTEGER(), nullable=True))
          batch_op.drop_constraint(batch_op.f('fk_ratings_anime_name_animes'), type_='foreignkey')
          batch_op.create_foreign_key('fk_ratings_anime_id_animes', 'animes', ['anime_id'], ['id'])
          batch_op.drop_column('anime_name')
  
      # ### end Alembic commands ###
  