rattail-harvest/rattail_harvest/db/alembic/versions/5505c0e60d28_add_project_deleted.py
Lance Edgar 3883a8551f Add HarvestProject.deleted flag to track deletions in Harvest
set this flag instead of deleting project, so we do not lose other
info about it.  can delete manually if truly unwanted
2022-01-30 12:14:42 -06:00

34 lines
746 B
Python

# -*- coding: utf-8; -*-
"""add project.deleted
Revision ID: 5505c0e60d28
Revises: d59ce24c2f9f
Create Date: 2022-01-30 12:08:04.338229
"""
# revision identifiers, used by Alembic.
revision = '5505c0e60d28'
down_revision = 'd59ce24c2f9f'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
import rattail.db.types
def upgrade():
# harvest_project
op.add_column('harvest_project', sa.Column('deleted', sa.Boolean(), nullable=True))
op.add_column('harvest_project_version', sa.Column('deleted', sa.Boolean(), autoincrement=False, nullable=True))
def downgrade():
# harvest_project
op.drop_column('harvest_project_version', 'deleted')
op.drop_column('harvest_project', 'deleted')