
# revision identifiers, used by Alembic.
revision = '2b9dd6f7593a'
down_revision = '48a1991e5dbd'

from alembic import op
import sqlalchemy as sa


def upgrade():
    op.add_column('easfoldersyncstatus', sa.Column('sync_should_run',
                  sa.Boolean(), server_default=sa.sql.expression.true(),
                  nullable=False))


def downgrade():
    op.drop_column('easfoldersyncstatus', 'sync_should_run')


# revision identifiers, used by Alembic.
revision = '2b9dd6f7593a'
down_revision = '48a1991e5dbd'

from alembic import op
import sqlalchemy as sa


def upgrade():
    from inbox.ignition import main_engine
    engine = main_engine(pool_size=1, max_overflow=0)
    if not engine.has_table('easfoldersyncstatus'):
        return
    op.add_column('easfoldersyncstatus', sa.Column('sync_should_run',
                  sa.Boolean(), server_default=sa.sql.expression.true(),
                  nullable=False))


def downgrade():
    from inbox.ignition import main_engine
    engine = main_engine(pool_size=1, max_overflow=0)
    if not engine.has_table('easfoldersyncstatus'):
        return
    op.drop_column('easfoldersyncstatus', 'sync_should_run')

Update migration 177 to check for table existence first
Update migration 177 to check for table existence first

  
  # revision identifiers, used by Alembic.
  revision = '2b9dd6f7593a'
  down_revision = '48a1991e5dbd'
  
  from alembic import op
  import sqlalchemy as sa
  
  
  def upgrade():
+     from inbox.ignition import main_engine
+     engine = main_engine(pool_size=1, max_overflow=0)
+     if not engine.has_table('easfoldersyncstatus'):
+         return
      op.add_column('easfoldersyncstatus', sa.Column('sync_should_run',
                    sa.Boolean(), server_default=sa.sql.expression.true(),
                    nullable=False))
  
  
  def downgrade():
+     from inbox.ignition import main_engine
+     engine = main_engine(pool_size=1, max_overflow=0)
+     if not engine.has_table('easfoldersyncstatus'):
+         return
      op.drop_column('easfoldersyncstatus', 'sync_should_run')
  
Update migration 177 to check for table existence first
## Code Before:

# revision identifiers, used by Alembic.
revision = '2b9dd6f7593a'
down_revision = '48a1991e5dbd'

from alembic import op
import sqlalchemy as sa


def upgrade():
    op.add_column('easfoldersyncstatus', sa.Column('sync_should_run',
                  sa.Boolean(), server_default=sa.sql.expression.true(),
                  nullable=False))


def downgrade():
    op.drop_column('easfoldersyncstatus', 'sync_should_run')

## Instruction:
Update migration 177 to check for table existence first
## Code After:

# revision identifiers, used by Alembic.
revision = '2b9dd6f7593a'
down_revision = '48a1991e5dbd'

from alembic import op
import sqlalchemy as sa


def upgrade():
    from inbox.ignition import main_engine
    engine = main_engine(pool_size=1, max_overflow=0)
    if not engine.has_table('easfoldersyncstatus'):
        return
    op.add_column('easfoldersyncstatus', sa.Column('sync_should_run',
                  sa.Boolean(), server_default=sa.sql.expression.true(),
                  nullable=False))


def downgrade():
    from inbox.ignition import main_engine
    engine = main_engine(pool_size=1, max_overflow=0)
    if not engine.has_table('easfoldersyncstatus'):
        return
    op.drop_column('easfoldersyncstatus', 'sync_should_run')
