Files
notifications-api/migrations/versions/0113_job_created_by_nullable.py

26 lines
651 B
Python
Raw Normal View History

"""empty message
Revision ID: 0113_job_created_by_nullable
Revises: 0112_add_start_end_dates
Create Date: 2017-07-27 11:12:34.938086
"""
# revision identifiers, used by Alembic.
2023-08-29 14:54:30 -07:00
revision = "0113_job_created_by_nullable"
down_revision = "0112_add_start_end_dates"
import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import postgresql
2023-08-29 14:54:30 -07:00
def upgrade():
2023-08-29 14:54:30 -07:00
op.alter_column("jobs", "created_by_id", nullable=True)
def downgrade():
# This will error if there are any jobs with no created_by - we'll have to decide how to handle those as and when
# we downgrade
2023-08-29 14:54:30 -07:00
op.alter_column("jobs", "created_by_id", nullable=False)