text: """Make selected_locales.locale NOT NULL
  
  Revision ID: a1c3be680840
  Revises: 6a00ada8daae
  Create Date: 2020-05-02 14:07:56.203700
  
  """
  from alembic import op
  import sqlalchemy as sa
  
  
  # revision identifiers, used by Alembic.
  revision = 'a1c3be680840'
  down_revision = '6a00ada8daae'
  branch_labels = None
  depends_on = None
  
  
  def upgrade():
      op.execute('DELETE FROM selected_locales WHERE locale IS NULL')
      # ### commands auto generated by Alembic ###
      with op.batch_alter_table('selected_locales', schema=None) as batch_op:
          batch_op.alter_column('locale',
                                existing_type=sa.VARCHAR(length=20),
                                nullable=False)
      # ### end Alembic commands ###
  
  
  def downgrade():
      # ### commands auto generated by Alembic ###
      with op.batch_alter_table('selected_locales', schema=None) as batch_op:
          batch_op.alter_column('locale',
                                existing_type=sa.VARCHAR(length=20),
                                nullable=True)
      # ### end Alembic commands ###
  