mirror of
https://github.com/Hestia-Homes/survey-extraction.git
synced 2026-06-08 11:17:29 +00:00
migrations scripts
This commit is contained in:
parent
37ba26a2fe
commit
ff4268a05e
2 changed files with 75 additions and 0 deletions
34
alembic/versions/29113d69989e_enum_things.py
Normal file
34
alembic/versions/29113d69989e_enum_things.py
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
"""enum things
|
||||
|
||||
Revision ID: 29113d69989e
|
||||
Revises: 2cf02c9f71f8
|
||||
Create Date: 2025-08-19 11:40:52.712131
|
||||
|
||||
"""
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = '29113d69989e'
|
||||
down_revision: Union[str, None] = '2cf02c9f71f8'
|
||||
branch_labels: Union[str, Sequence[str], None] = None
|
||||
depends_on: Union[str, Sequence[str], None] = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
op.execute("ALTER TYPE reporttype ADD VALUE IF NOT EXISTS 'osmosis_condition_pas_2035_report'")
|
||||
op.execute("ALTER TYPE reporttype ADD VALUE IF NOT EXISTS 'warm_homes_condition_pas_2035_report'")
|
||||
op.execute("ALTER TYPE reporttype ADD VALUE IF NOT EXISTS 'energy_performance_report_with_data'")
|
||||
op.execute("ALTER TYPE reporttype ADD VALUE IF NOT EXISTS 'energy_performance_report_summary_information'")
|
||||
op.execute("ALTER TYPE reporttype ADD VALUE IF NOT EXISTS 'lodgement_xml_needed_for_lodgement_to_like_trademark'")
|
||||
op.execute("ALTER TYPE reporttype ADD VALUE IF NOT EXISTS 'reduce_xml_needed_to_generate_full_sap_xml'")
|
||||
op.execute("ALTER TYPE reporttype ADD VALUE IF NOT EXISTS 'full_xml_needed_for_co_ordination'")
|
||||
|
||||
def downgrade() -> None:
|
||||
"""Downgrade schema."""
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
pass
|
||||
# ### end Alembic commands ###
|
||||
41
alembic/versions/2cf02c9f71f8_add_missing_report_type.py
Normal file
41
alembic/versions/2cf02c9f71f8_add_missing_report_type.py
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
"""add missing report type
|
||||
|
||||
Revision ID: 2cf02c9f71f8
|
||||
Revises: 253a1047c623
|
||||
Create Date: 2025-08-19 11:36:16.006276
|
||||
|
||||
"""
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import postgresql
|
||||
from sqlalchemy.dialects import postgresql as psql
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = '2cf02c9f71f8'
|
||||
down_revision: Union[str, None] = '253a1047c623'
|
||||
branch_labels: Union[str, Sequence[str], None] = None
|
||||
depends_on: Union[str, Sequence[str], None] = None
|
||||
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
op.alter_column(
|
||||
"uploaded_files",
|
||||
"s3_json_uri",
|
||||
type_=psql.JSON(), # or psql.JSONB()
|
||||
postgresql_using="s3_json_uri::json", # or ::jsonb
|
||||
existing_type=sa.VARCHAR(),
|
||||
existing_nullable=True,
|
||||
)
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
"""Downgrade schema."""
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.alter_column('uploaded_files', 's3_json_uri',
|
||||
existing_type=postgresql.JSON(astext_type=sa.Text()),
|
||||
type_=sa.VARCHAR(),
|
||||
existing_nullable=True)
|
||||
# ### end Alembic commands ###
|
||||
Loading…
Add table
Reference in a new issue