-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
32 additions
and
2 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
alembic/versions/eb501cf9f471_change_siri_ride_stop_id_to_big_int.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,30 @@ | ||
"""change siri_ride_stop_id to big int | ||
Revision ID: eb501cf9f471 | ||
Revises: a851bbd0b02d | ||
Create Date: 2024-10-24 17:16:40.993722+00:00 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
import open_bus_stride_db | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = 'eb501cf9f471' | ||
down_revision = 'a851bbd0b02d' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
op.alter_column('siri_vehicle_location', 'siri_ride_stop_id', existing_type=sa.Integer, type_=sa.BigInteger) | ||
op.alter_column('siri_ride_stop', 'id', existing_type=sa.Integer, type_=sa.BigInteger) | ||
op.execute('ALTER SEQUENCE siri_ride_stop_id_seq AS BIGINT') | ||
op.execute('SELECT setval(\'siri_ride_stop_id_seq\', 2147483431)') | ||
|
||
|
||
def downgrade(): | ||
raise Exception('Cannot downgrade') |
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
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