mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-02 17:31:14 -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
|
||||
from sqlalchemy.dialects import postgresql
|
||||
|
||||
|
||||
def upgrade():
|
||||
op.alter_column('jobs', 'job_status',
|
||||
existing_type=sa.VARCHAR(length=255),
|
||||
nullable=False)
|
||||
op.drop_column('jobs', 'status')
|
||||
op.alter_column('jobs', 'job_status', existing_type=sa.VARCHAR(length=255), nullable=False)
|
||||
op.alter_column('jobs', 'status', existing_type=sa.VARCHAR(length=255), nullable=True)
|
||||
|
||||
|
||||
def downgrade():
|
||||
# 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', 'job_status',
|
||||
existing_type=sa.VARCHAR(length=255),
|
||||
nullable=True)
|
||||
op.alter_column('jobs', 'status', existing_type=sa.VARCHAR(length=255), nullable=False)
|
||||
op.alter_column('jobs', 'job_status', existing_type=sa.VARCHAR(length=255), nullable=True)
|
||||
|
||||
Reference in New Issue
Block a user