mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-04 18:31:13 -05:00
Changed 0052 to not drop the column, rather set it to allow nulls.
This allows existing code to run.
This commit is contained in:
@@ -14,16 +14,13 @@ from alembic import op
|
|||||||
import sqlalchemy as sa
|
import sqlalchemy as sa
|
||||||
from sqlalchemy.dialects import postgresql
|
from sqlalchemy.dialects import postgresql
|
||||||
|
|
||||||
|
|
||||||
def upgrade():
|
def upgrade():
|
||||||
op.alter_column('jobs', 'job_status',
|
op.alter_column('jobs', 'job_status', existing_type=sa.VARCHAR(length=255), nullable=False)
|
||||||
existing_type=sa.VARCHAR(length=255),
|
op.alter_column('jobs', 'status', existing_type=sa.VARCHAR(length=255), nullable=True)
|
||||||
nullable=False)
|
|
||||||
op.drop_column('jobs', 'status')
|
|
||||||
|
|
||||||
|
|
||||||
def downgrade():
|
def downgrade():
|
||||||
# this downgrade leaves status empty and with no not null constraint.
|
# this downgrade leaves status empty and with no not null constraint.
|
||||||
op.add_column('jobs', sa.Column('status', postgresql.ENUM('pending', 'in progress', 'finished', 'sending limits exceeded', name='job_status_types'), autoincrement=False, nullable=True))
|
op.alter_column('jobs', 'status', existing_type=sa.VARCHAR(length=255), nullable=False)
|
||||||
op.alter_column('jobs', 'job_status',
|
op.alter_column('jobs', 'job_status', existing_type=sa.VARCHAR(length=255), nullable=True)
|
||||||
existing_type=sa.VARCHAR(length=255),
|
|
||||||
nullable=True)
|
|
||||||
|
|||||||
Reference in New Issue
Block a user