2018-02-10 01:32:14 +00:00
|
|
|
"""
|
|
|
|
|
|
2018-02-15 09:47:28 +00:00
|
|
|
Revision ID: 0164_add_organisation_to_service
|
2018-02-10 01:32:14 +00:00
|
|
|
Revises: 0163_add_new_org_model
|
|
|
|
|
Create Date: 2018-02-09 17:58:34.617206
|
|
|
|
|
|
|
|
|
|
"""
|
2024-04-01 15:12:33 -07:00
|
|
|
|
2018-02-10 01:32:14 +00:00
|
|
|
import sqlalchemy as sa
|
2023-12-08 21:43:52 -05:00
|
|
|
from alembic import op
|
2018-02-10 01:32:14 +00:00
|
|
|
from sqlalchemy.dialects import postgresql
|
|
|
|
|
|
2023-08-29 14:54:30 -07:00
|
|
|
revision = "0164_add_organisation_to_service"
|
|
|
|
|
down_revision = "0163_add_new_org_model"
|
2018-02-10 01:32:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
def upgrade():
|
|
|
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
2023-08-29 14:54:30 -07:00
|
|
|
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"),
|
2018-02-10 01:32:14 +00:00
|
|
|
)
|
|
|
|
|
# ### end Alembic commands ###
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def downgrade():
|
|
|
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
2023-08-29 14:54:30 -07:00
|
|
|
op.drop_table("organisation_to_service")
|
2018-02-10 01:32:14 +00:00
|
|
|
# ### end Alembic commands ###
|