Trasu z GPX nahravat do DB
This commit is contained in:
+46
@@ -0,0 +1,46 @@
|
||||
"""add speed, elevation, altitude to track
|
||||
|
||||
Revision ID: 03de3f7f8fdd
|
||||
Revises: 8cc01c03e980
|
||||
Create Date: 2024-07-11 07:45:59.376941
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '03de3f7f8fdd'
|
||||
down_revision = '8cc01c03e980'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('track', sa.Column('min_speed', sa.Float(), nullable=True))
|
||||
op.add_column('track', sa.Column('max_speed', sa.Float(), nullable=True))
|
||||
op.add_column('track', sa.Column('avg_speed', sa.Float(), nullable=True))
|
||||
op.add_column('track', sa.Column('max_altitude', sa.Float(), nullable=True))
|
||||
op.add_column('track', sa.Column('avg_altitude', sa.Float(), nullable=True))
|
||||
op.add_column('track', sa.Column('total_duration', sa.Integer(), nullable=True, comment='Total duration in seconds'))
|
||||
op.add_column('track_point', sa.Column('terrain_elevation', sa.Float(), nullable=True))
|
||||
op.add_column('track_point', sa.Column('speed', sa.Float(), nullable=True))
|
||||
op.add_column('track_point', sa.Column('altitude', sa.Float(), nullable=True))
|
||||
op.add_column('track_point', sa.Column('magnetic_variation', sa.Float(), nullable=True))
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column('track_point', 'magnetic_variation')
|
||||
op.drop_column('track_point', 'altitude')
|
||||
op.drop_column('track_point', 'speed')
|
||||
op.drop_column('track_point', 'terrain_elevation')
|
||||
op.drop_column('track', 'total_duration')
|
||||
op.drop_column('track', 'avg_altitude')
|
||||
op.drop_column('track', 'max_altitude')
|
||||
op.drop_column('track', 'avg_speed')
|
||||
op.drop_column('track', 'max_speed')
|
||||
op.drop_column('track', 'min_speed')
|
||||
# ### end Alembic commands ###
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
"""delete duplicated column with altitude
|
||||
|
||||
Revision ID: e3620deb41b6
|
||||
Revises: 03de3f7f8fdd
|
||||
Create Date: 2024-07-15 06:35:13.536320
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import mysql
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'e3620deb41b6'
|
||||
down_revision = '03de3f7f8fdd'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
|
||||
op.rename_table("flight_track", "flight_turn_point")
|
||||
op.create_index(op.f('ix_track_point_timestamp'), 'track_point', ['timestamp'], unique=False)
|
||||
op.drop_column('track_point', 'elevation')
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('track_point', sa.Column('elevation', mysql.FLOAT(), nullable=True))
|
||||
op.drop_index(op.f('ix_track_point_timestamp'), table_name='track_point')
|
||||
op.rename_table("flight_turn_point", "flight_track")
|
||||
# ### end Alembic commands ###
|
||||
Reference in New Issue
Block a user