API pro podporu vytvareni letu z planu
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
"""add flight.flight_plan_id fk
|
||||
|
||||
Revision ID: 989152b7184a
|
||||
Revises: f9e1e8a01683
|
||||
Create Date: 2024-06-27 17:09:19.933094
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '989152b7184a'
|
||||
down_revision = 'f9e1e8a01683'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('flight', sa.Column('flight_plan_id', sa.Integer(), nullable=True))
|
||||
op.create_foreign_key(None, 'flight', 'flight_plan', ['flight_plan_id'], ['id'])
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_constraint(None, 'flight', type_='foreignkey')
|
||||
op.drop_column('flight', 'flight_plan_id')
|
||||
# ### end Alembic commands ###
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
"""Add poi and airport id to flight plan track marker
|
||||
|
||||
Revision ID: 8cc01c03e980
|
||||
Revises: 989152b7184a
|
||||
Create Date: 2024-06-30 00:27:08.976891
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import mysql
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '8cc01c03e980'
|
||||
down_revision = '989152b7184a'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.alter_column('airport', 'openaip_id',
|
||||
existing_type=mysql.VARCHAR(length=32),
|
||||
nullable=True)
|
||||
op.add_column('flight_plan_marker', sa.Column('airport_id', sa.Integer(), nullable=True))
|
||||
op.add_column('flight_plan_marker', sa.Column('point_of_interest_id', sa.Integer(), nullable=True))
|
||||
op.create_foreign_key(None, 'flight_plan_marker', 'point_of_interest', ['point_of_interest_id'], ['id'])
|
||||
op.create_foreign_key(None, 'flight_plan_marker', 'airport', ['airport_id'], ['id'])
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_constraint(None, 'flight_plan_marker', type_='foreignkey')
|
||||
op.drop_constraint(None, 'flight_plan_marker', type_='foreignkey')
|
||||
op.drop_column('flight_plan_marker', 'point_of_interest_id')
|
||||
op.drop_column('flight_plan_marker', 'airport_id')
|
||||
op.alter_column('airport', 'openaip_id',
|
||||
existing_type=mysql.VARCHAR(length=32),
|
||||
nullable=False)
|
||||
# ### end Alembic commands ###
|
||||
Reference in New Issue
Block a user