-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change column type FLOAT to DOUBLE in table route
Aligning all lat/lng to be stored as DOUBLE
- Loading branch information
Showing
2 changed files
with
80 additions
and
26 deletions.
There are no files selected for viewing
54 changes: 54 additions & 0 deletions
54
alembic/versions/73063d78ff1c_convert_float_to_double_of_table_route.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,54 @@ | ||
"""Convert FLOAT to DOUBLE of table route | ||
Revision ID: 73063d78ff1c | ||
Revises: 258ab2aaf284 | ||
Create Date: 2023-08-12 08:20:45.607223 | ||
""" | ||
import sqlalchemy as sa | ||
|
||
from alembic import op | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = '73063d78ff1c' | ||
down_revision = '258ab2aaf284' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
op.alter_column('route', 'start_poi_latitude', | ||
existing_type=sa.Float(asdecimal=True), | ||
type_=sa.Double(asdecimal=True), | ||
existing_nullable=True) | ||
op.alter_column('route', 'start_poi_longitude', | ||
existing_type=sa.Float(asdecimal=True), | ||
type_=sa.Double(asdecimal=True), | ||
existing_nullable=True) | ||
op.alter_column('route', 'end_poi_latitude', | ||
existing_type=sa.Float(asdecimal=True), | ||
type_=sa.Double(asdecimal=True), | ||
existing_nullable=True) | ||
op.alter_column('route', 'end_poi_longitude', | ||
existing_type=sa.Float(asdecimal=True), | ||
type_=sa.Double(asdecimal=True), | ||
existing_nullable=True) | ||
|
||
|
||
def downgrade(): | ||
op.alter_column('route', 'start_poi_latitude', | ||
existing_type=sa.Double(asdecimal=True), | ||
type_=sa.Float(asdecimal=True), | ||
existing_nullable=True) | ||
op.alter_column('route', 'start_poi_longitude', | ||
existing_type=sa.Double(asdecimal=True), | ||
type_=sa.Float(asdecimal=True), | ||
existing_nullable=True) | ||
op.alter_column('route', 'end_poi_latitude', | ||
existing_type=sa.Double(asdecimal=True), | ||
type_=sa.Float(asdecimal=True), | ||
existing_nullable=True) | ||
op.alter_column('route', 'end_poi_longitude', | ||
existing_type=sa.Double(asdecimal=True), | ||
type_=sa.Float(asdecimal=True), | ||
existing_nullable=True) |
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