This commit is contained in:
Kenneth Kehl
2023-08-29 14:54:30 -07:00
parent 19dcd7a48b
commit 1ecb747c6d
588 changed files with 34100 additions and 23589 deletions

View File

@@ -9,21 +9,30 @@ from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
revision = '0304_remove_org_to_service'
down_revision = '0303_populate_services_org_id'
revision = "0304_remove_org_to_service"
down_revision = "0303_populate_services_org_id"
def upgrade():
op.drop_table('organisation_to_service')
op.drop_table("organisation_to_service")
def downgrade():
op.create_table('organisation_to_service',
sa.Column('service_id', postgresql.UUID(), autoincrement=False, nullable=False),
sa.Column('organisation_id', postgresql.UUID(), autoincrement=False, nullable=False),
sa.ForeignKeyConstraint(['organisation_id'], ['organisation.id'],
name='organisation_to_service_organisation_id_fkey'),
sa.ForeignKeyConstraint(['service_id'], ['services.id'],
name='organisation_to_service_service_id_fkey'),
sa.PrimaryKeyConstraint('service_id', name='organisation_to_service_pkey')
)
op.create_table(
"organisation_to_service",
sa.Column("service_id", postgresql.UUID(), autoincrement=False, nullable=False),
sa.Column(
"organisation_id", postgresql.UUID(), autoincrement=False, nullable=False
),
sa.ForeignKeyConstraint(
["organisation_id"],
["organisation.id"],
name="organisation_to_service_organisation_id_fkey",
),
sa.ForeignKeyConstraint(
["service_id"],
["services.id"],
name="organisation_to_service_service_id_fkey",
),
sa.PrimaryKeyConstraint("service_id", name="organisation_to_service_pkey"),
)