Skip to content

Commit fab5e33

Browse files
committed
GH-212: Remove authority and capital scheme schemas
1 parent e2b62ff commit fab5e33

2 files changed

Lines changed: 68 additions & 0 deletions

File tree

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
"""Remove capital scheme schema
2+
3+
Revision ID: 2b238e72b6f7
4+
Revises: 25d12b908392
5+
Create Date: 2026-06-16 13:51:18.797750
6+
7+
"""
8+
9+
from typing import Sequence, Union
10+
11+
from alembic import op
12+
from sqlalchemy.dialects.postgresql.base import PGDialect
13+
14+
revision: str = "2b238e72b6f7"
15+
down_revision: Union[str, None] = "25d12b908392"
16+
branch_labels: Union[str, Sequence[str], None] = None
17+
depends_on: Union[str, Sequence[str], None] = None
18+
19+
20+
def upgrade() -> None:
21+
op.drop_table("capital_scheme_overview", schema="capital_scheme")
22+
op.drop_table("capital_scheme_bid_status", schema="capital_scheme")
23+
op.drop_table("capital_scheme_financial", schema="capital_scheme")
24+
op.drop_table("capital_scheme_milestone", schema="capital_scheme")
25+
op.drop_table("capital_scheme_intervention", schema="capital_scheme")
26+
op.drop_table("capital_scheme_authority_review", schema="capital_scheme")
27+
op.drop_table("capital_scheme", schema="capital_scheme")
28+
29+
if op.get_context().dialect.name == PGDialect.name:
30+
op.execute("DROP SCHEMA capital_scheme")
31+
else:
32+
op.execute("DETACH DATABASE capital_scheme")
33+
34+
35+
def downgrade() -> None:
36+
# Not supported
37+
pass
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
"""Remove authority schema
2+
3+
Revision ID: c1d744bc16bd
4+
Revises: 2b238e72b6f7
5+
Create Date: 2026-06-16 14:08:54.833370
6+
7+
"""
8+
9+
from typing import Sequence, Union
10+
11+
from alembic import op
12+
from sqlalchemy.dialects.postgresql.base import PGDialect
13+
14+
revision: str = "c1d744bc16bd"
15+
down_revision: Union[str, None] = "2b238e72b6f7"
16+
branch_labels: Union[str, Sequence[str], None] = None
17+
depends_on: Union[str, Sequence[str], None] = None
18+
19+
20+
def upgrade() -> None:
21+
op.drop_table("authority", schema="authority")
22+
23+
if op.get_context().dialect.name == PGDialect.name:
24+
op.execute("DROP SCHEMA authority")
25+
else:
26+
op.execute("DETACH DATABASE authority")
27+
28+
29+
def downgrade() -> None:
30+
# Not supported
31+
pass

0 commit comments

Comments
 (0)