mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-14 17:22:17 -05:00
37 lines
1.7 KiB
Python
37 lines
1.7 KiB
Python
|
|
"""empty message
|
||
|
|
|
||
|
|
Revision ID: 0068_add_created_by_to_provider
|
||
|
|
Revises: 0067_service_contact_block
|
||
|
|
Create Date: 2017-03-02 17:47:17.586815
|
||
|
|
|
||
|
|
"""
|
||
|
|
|
||
|
|
# revision identifiers, used by Alembic.
|
||
|
|
revision = '0068_add_created_by_to_provider'
|
||
|
|
down_revision = '0067_service_contact_block'
|
||
|
|
|
||
|
|
from alembic import op
|
||
|
|
import sqlalchemy as sa
|
||
|
|
from sqlalchemy.dialects import postgresql
|
||
|
|
|
||
|
|
def upgrade():
|
||
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
||
|
|
op.add_column('provider_details', sa.Column('created_by_id', postgresql.UUID(as_uuid=True), nullable=True))
|
||
|
|
op.create_index(op.f('ix_provider_details_created_by_id'), 'provider_details', ['created_by_id'], unique=False)
|
||
|
|
op.create_foreign_key(None, 'provider_details', 'users', ['created_by_id'], ['id'])
|
||
|
|
op.add_column('provider_details_history', sa.Column('created_by_id', postgresql.UUID(as_uuid=True), nullable=True))
|
||
|
|
op.create_index(op.f('ix_provider_details_history_created_by_id'), 'provider_details_history', ['created_by_id'], unique=False)
|
||
|
|
op.create_foreign_key(None, 'provider_details_history', 'users', ['created_by_id'], ['id'])
|
||
|
|
# ### end Alembic commands ###
|
||
|
|
|
||
|
|
|
||
|
|
def downgrade():
|
||
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
||
|
|
op.drop_constraint(None, 'provider_details_history', type_='foreignkey')
|
||
|
|
op.drop_index(op.f('ix_provider_details_history_created_by_id'), table_name='provider_details_history')
|
||
|
|
op.drop_column('provider_details_history', 'created_by_id')
|
||
|
|
op.drop_constraint(None, 'provider_details', type_='foreignkey')
|
||
|
|
op.drop_index(op.f('ix_provider_details_created_by_id'), table_name='provider_details')
|
||
|
|
op.drop_column('provider_details', 'created_by_id')
|
||
|
|
# ### end Alembic commands ###
|