
# revision identifiers, used by Alembic.
revision = '486c7fa5b533'
down_revision = 'c77a90d524'

from alembic import op
import sqlalchemy as sa
from sqlalchemy.sql import text


def upgrade():
    conn = op.get_bind()
    conn.execute(text("set @@lock_wait_timeout = 20;"))

    op.add_column('thread', sa.Column('_cleaned_subject',
                                      sa.String(length=255), nullable=True))
    op.create_index('ix_cleaned_subject', 'thread',
                    ['namespace_id', '_cleaned_subject'], unique=False)


def downgrade():
    conn = op.get_bind()
    conn.execute(text("set @@lock_wait_timeout = 20;"))

    op.drop_index('ix_cleaned_subject', table_name='thread')
    op.drop_column('thread', '_cleaned_subject')


# revision identifiers, used by Alembic.
revision = '486c7fa5b533'
down_revision = 'c77a90d524'

from alembic import op
import sqlalchemy as sa
from sqlalchemy.sql import text


def upgrade():
    conn = op.get_bind()
    conn.execute(text("set @@lock_wait_timeout = 20;"))

    op.add_column('thread', sa.Column('_cleaned_subject',
                                      sa.String(length=255), nullable=True))
    op.create_index('ix_cleaned_subject', 'thread', ['_cleaned_subject'],
                    unique=False)


def downgrade():
    conn = op.get_bind()
    conn.execute(text("set @@lock_wait_timeout = 20;"))

    op.drop_index('ix_cleaned_subject', table_name='thread')
    op.drop_column('thread', '_cleaned_subject')

Make _cleaned_subject migration match declared schema.
Make _cleaned_subject migration match declared schema.

Test Plan: Upgrade old database to head.

Reviewers: kav-ya

Reviewed By: kav-ya

Differential Revision: https://review.inboxapp.com/D1394

  
  # revision identifiers, used by Alembic.
  revision = '486c7fa5b533'
  down_revision = 'c77a90d524'
  
  from alembic import op
  import sqlalchemy as sa
  from sqlalchemy.sql import text
  
  
  def upgrade():
      conn = op.get_bind()
      conn.execute(text("set @@lock_wait_timeout = 20;"))
  
      op.add_column('thread', sa.Column('_cleaned_subject',
                                        sa.String(length=255), nullable=True))
-     op.create_index('ix_cleaned_subject', 'thread',
+     op.create_index('ix_cleaned_subject', 'thread', ['_cleaned_subject'],
-                     ['namespace_id', '_cleaned_subject'], unique=False)
+                     unique=False)
  
  
  def downgrade():
      conn = op.get_bind()
      conn.execute(text("set @@lock_wait_timeout = 20;"))
  
      op.drop_index('ix_cleaned_subject', table_name='thread')
      op.drop_column('thread', '_cleaned_subject')
  
Make _cleaned_subject migration match declared schema.
## Code Before:

# revision identifiers, used by Alembic.
revision = '486c7fa5b533'
down_revision = 'c77a90d524'

from alembic import op
import sqlalchemy as sa
from sqlalchemy.sql import text


def upgrade():
    conn = op.get_bind()
    conn.execute(text("set @@lock_wait_timeout = 20;"))

    op.add_column('thread', sa.Column('_cleaned_subject',
                                      sa.String(length=255), nullable=True))
    op.create_index('ix_cleaned_subject', 'thread',
                    ['namespace_id', '_cleaned_subject'], unique=False)


def downgrade():
    conn = op.get_bind()
    conn.execute(text("set @@lock_wait_timeout = 20;"))

    op.drop_index('ix_cleaned_subject', table_name='thread')
    op.drop_column('thread', '_cleaned_subject')

## Instruction:
Make _cleaned_subject migration match declared schema.
## Code After:

# revision identifiers, used by Alembic.
revision = '486c7fa5b533'
down_revision = 'c77a90d524'

from alembic import op
import sqlalchemy as sa
from sqlalchemy.sql import text


def upgrade():
    conn = op.get_bind()
    conn.execute(text("set @@lock_wait_timeout = 20;"))

    op.add_column('thread', sa.Column('_cleaned_subject',
                                      sa.String(length=255), nullable=True))
    op.create_index('ix_cleaned_subject', 'thread', ['_cleaned_subject'],
                    unique=False)


def downgrade():
    conn = op.get_bind()
    conn.execute(text("set @@lock_wait_timeout = 20;"))

    op.drop_index('ix_cleaned_subject', table_name='thread')
    op.drop_column('thread', '_cleaned_subject')
