@@ -0,0 +1,2013 @@
+%22%22%22Tighten EAS constraints and fix easfoldersync state enum.%0A%0ARevision ID: 3f96e92953e1%0ARevises: 55f0ff54c776%0ACreate Date: 2014-05-21 17:43:44.556716%0A%0A%22%22%22%0A%0A# revision identifiers, used by Alembic.%0Arevision = '3f96e92953e1'%0Adown_revision = '55f0ff54c776'%0A%0Afrom alembic import op%0Aimport sqlalchemy as sa%0Afrom sqlalchemy.ext.declarative import declarative_base%0A%0A%0Adef upgrade():%0A    from inbox.server.models import engine%0A    Base = declarative_base()%0A    Base.metadata.reflect(engine)%0A%0A    if 'easfoldersync' in Base.metadata.tables:%0A        op.alter_column('easfoldersync', 'state',%0A                        type_=sa.Enum('initial', 'initial keyinvalid',%0A                                      'poll', 'poll keyinvalid', 'finish'),%0A                        existing_nullable=False,%0A                        server_default='initial')%0A%0A    if 'easuid' in Base.metadata.tables:%0A        op.alter_column('easuid', 'message_id', existing_type=sa.Integer(),%0A                        nullable=False)%0A        op.alter_column('easuid', 'fld_uid', existing_type=sa.Integer(),%0A                        nullable=False)%0A        op.alter_column('easuid', 'msg_uid', existing_type=sa.Integer(),%0A                        nullable=False)%0A%0A%0Adef downgrade():%0A    from inbox.server.models import engine%0A    Base = declarative_base()%0A    Base.metadata.reflect(engine)%0A%0A    if 'easfoldersync' in Base.metadata.tables:%0A        op.alter_column('easfoldersync', 'state',%0A                        type_=sa.Enum('initial', 'initial uidinvalid',%0A                                      'poll', 'poll uidinvalid', 'finish'),%0A                        existing_nullable=False)%0A%0A    if 'easuid' in Base.metadata.tables:%0A        op.alter_column('easuid', 'message_id', existing_type=sa.Integer(),%0A                        nullable=True)%0A        op.alter_column('easuid', 'fld_uid', existing_type=sa.Integer(),%0A                        nullable=True)%0A        op.alter_column('easuid', 'msg_uid', existing_type=sa.Integer(),%0A                        nullable=True)%0A

Fix nullable constraints on EASUid and EASFoldersync state enum.