-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dev migrations are now just a copy of staging migrations.
- Loading branch information
1 parent
93a0066
commit 139d1ae
Showing
22 changed files
with
875 additions
and
3,391 deletions.
There are no files selected for viewing
573 changes: 573 additions & 0 deletions
573
...mp_py/migrations/versions/performance_manager_dev/001_5d9a7ee21ae5_initial_prod_schema.py
Large diffs are not rendered by default.
Oops, something went wrong.
255 changes: 0 additions & 255 deletions
255
...amp_py/migrations/versions/performance_manager_dev/001_be4c10c548f0_initial_rds_schema.py
This file was deleted.
Oops, something went wrong.
120 changes: 120 additions & 0 deletions
120
...amp_py/migrations/versions/performance_manager_dev/002_1b53fd278b10_fix_trip_id_length.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
"""fix trip id length | ||
Revision ID: 1b53fd278b10 | ||
Revises: 5d9a7ee21ae5 | ||
Create Date: 2023-11-27 16:25:42.657967 | ||
Details | ||
* upgrade -> change "trip_id" field from length 128 to 512 | ||
* downgrade -> change "trip_id" field from length 512 to 128 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
from lamp_py.migrations.versions.performance_manager_staging.sql_strings.strings_001 import ( | ||
view_opmi_all_rt_fields_joined, | ||
) | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "1b53fd278b10" | ||
down_revision = "5d9a7ee21ae5" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.execute("DROP VIEW IF EXISTS opmi_all_rt_fields_joined;") | ||
op.alter_column( | ||
"static_route_patterns", | ||
"representative_trip_id", | ||
existing_type=sa.VARCHAR(length=128), | ||
type_=sa.String(length=512), | ||
existing_nullable=False, | ||
) | ||
op.alter_column( | ||
"static_stop_times", | ||
"trip_id", | ||
existing_type=sa.VARCHAR(length=128), | ||
type_=sa.String(length=512), | ||
existing_nullable=False, | ||
) | ||
op.alter_column( | ||
"static_trips", | ||
"trip_id", | ||
existing_type=sa.VARCHAR(length=128), | ||
type_=sa.String(length=512), | ||
existing_nullable=False, | ||
) | ||
op.alter_column( | ||
"temp_event_compare", | ||
"trip_id", | ||
existing_type=sa.VARCHAR(length=128), | ||
type_=sa.String(length=512), | ||
existing_nullable=False, | ||
) | ||
op.alter_column( | ||
"vehicle_trips", | ||
"trip_id", | ||
existing_type=sa.VARCHAR(length=128), | ||
type_=sa.String(length=512), | ||
existing_nullable=False, | ||
) | ||
op.alter_column( | ||
"vehicle_trips", | ||
"static_trip_id_guess", | ||
existing_type=sa.VARCHAR(length=128), | ||
type_=sa.String(length=512), | ||
existing_nullable=True, | ||
) | ||
op.execute(view_opmi_all_rt_fields_joined) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.execute("DROP VIEW IF EXISTS opmi_all_rt_fields_joined;") | ||
op.alter_column( | ||
"vehicle_trips", | ||
"static_trip_id_guess", | ||
existing_type=sa.String(length=512), | ||
type_=sa.VARCHAR(length=128), | ||
existing_nullable=True, | ||
) | ||
op.alter_column( | ||
"vehicle_trips", | ||
"trip_id", | ||
existing_type=sa.String(length=512), | ||
type_=sa.VARCHAR(length=128), | ||
existing_nullable=False, | ||
) | ||
op.alter_column( | ||
"temp_event_compare", | ||
"trip_id", | ||
existing_type=sa.String(length=512), | ||
type_=sa.VARCHAR(length=128), | ||
existing_nullable=False, | ||
) | ||
op.alter_column( | ||
"static_trips", | ||
"trip_id", | ||
existing_type=sa.String(length=512), | ||
type_=sa.VARCHAR(length=128), | ||
existing_nullable=False, | ||
) | ||
op.alter_column( | ||
"static_stop_times", | ||
"trip_id", | ||
existing_type=sa.String(length=512), | ||
type_=sa.VARCHAR(length=128), | ||
existing_nullable=False, | ||
) | ||
op.alter_column( | ||
"static_route_patterns", | ||
"representative_trip_id", | ||
existing_type=sa.String(length=512), | ||
type_=sa.VARCHAR(length=128), | ||
existing_nullable=False, | ||
) | ||
op.execute(view_opmi_all_rt_fields_joined) | ||
# ### end Alembic commands ### |
Oops, something went wrong.