Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /sustainability-software-lab_ca-biositing /alembic /versions /0001_initial_infra.py
| """Initial Infrastructure: Extensions and Schemas | |
| Revision ID: 0001 | |
| Revises: | |
| Create Date: 2024-05-08 18:24:00.000000 | |
| """ | |
| from typing import Sequence, Union | |
| from alembic import op | |
| # revision identifiers, used by Alembic. | |
| revision: str = '0001' | |
| down_revision: Union[str, Sequence[str], None] = None | |
| branch_labels: Union[str, Sequence[str], None] = None | |
| depends_on: Union[str, Sequence[str], None] = None | |
| def upgrade() -> None: | |
| # Extensions | |
| op.execute("CREATE EXTENSION IF NOT EXISTS postgis") | |
| op.execute("CREATE EXTENSION IF NOT EXISTS pg_trgm") | |
| op.execute("CREATE EXTENSION IF NOT EXISTS unaccent") | |
| op.execute("CREATE EXTENSION IF NOT EXISTS btree_gin") | |
| # Schemas | |
| op.execute("CREATE SCHEMA IF NOT EXISTS ca_biositing") | |
| op.execute("CREATE SCHEMA IF NOT EXISTS data_portal") | |
| def downgrade() -> None: | |
| op.execute("DROP SCHEMA IF EXISTS data_portal CASCADE") | |
| op.execute("DROP SCHEMA IF EXISTS ca_biositing CASCADE") | |
| op.execute("DROP EXTENSION IF EXISTS btree_gin") | |
| op.execute("DROP EXTENSION IF EXISTS unaccent") | |
| op.execute("DROP EXTENSION IF EXISTS pg_trgm") | |
| op.execute("DROP EXTENSION IF EXISTS postgis CASCADE") | |
Xet Storage Details
- Size:
- 1.17 kB
- Xet hash:
- 5ee35f84457d5244ecb7a6518b33baf4488f770def0a0053bbe0f608efb8f1e2
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.