mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-02 17:31:14 -05:00
Migration script to add organisation_to_service association table
This commit is contained in:
31
migrations/versions/0164_add_organisation_service.py
Normal file
31
migrations/versions/0164_add_organisation_service.py
Normal file
@@ -0,0 +1,31 @@
|
||||
"""
|
||||
|
||||
Revision ID: 0164_add_organisation_service
|
||||
Revises: 0163_add_new_org_model
|
||||
Create Date: 2018-02-09 17:58:34.617206
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import postgresql
|
||||
|
||||
revision = '0164_add_organisation_to_service'
|
||||
down_revision = '0163_add_new_org_model'
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('organisation_to_service',
|
||||
sa.Column('service_id', postgresql.UUID(as_uuid=True), nullable=False),
|
||||
sa.Column('organisation_id', postgresql.UUID(as_uuid=True), nullable=False),
|
||||
sa.ForeignKeyConstraint(['organisation_id'], ['organisation.id'], ),
|
||||
sa.ForeignKeyConstraint(['service_id'], ['services.id'], ),
|
||||
sa.PrimaryKeyConstraint('service_id')
|
||||
)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_table('organisation_to_service')
|
||||
# ### end Alembic commands ###
|
||||
Reference in New Issue
Block a user