Uprava struktury letu a fotky, uprava GPS pozic v DB
This commit is contained in:
@@ -7,7 +7,6 @@ Create Date: 2023-05-06 20:57:49.053470
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
import database.custom_types
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'de421195d45c'
|
||||
@@ -22,7 +21,7 @@ def upgrade() -> None:
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('name', sa.String(length=128), nullable=False),
|
||||
sa.Column('icao_code', sa.String(length=4), nullable=False),
|
||||
sa.Column('gps_position', database.custom_types.Point(), nullable=True),
|
||||
sa.Column('gps_position', sa.Integer(), nullable=True),
|
||||
sa.Column('elevation', sa.Integer(), nullable=True),
|
||||
sa.Column('created_at', sa.DateTime(), server_default=sa.text('now()'), nullable=False),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
@@ -94,7 +93,7 @@ def upgrade() -> None:
|
||||
op.create_table('point_of_interest',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('name', sa.String(length=128), nullable=False),
|
||||
sa.Column('gps_position', database.custom_types.Point(), nullable=True),
|
||||
sa.Column('gps_position', sa.Integer(), nullable=True),
|
||||
sa.Column('type_id', sa.Integer(), nullable=False),
|
||||
sa.Column('is_public', sa.Boolean(), server_default='0', nullable=False),
|
||||
sa.Column('created_by_id', sa.Integer(), nullable=False),
|
||||
@@ -155,7 +154,7 @@ def upgrade() -> None:
|
||||
sa.Column('name', sa.String(length=128), nullable=False),
|
||||
sa.Column('filename', sa.String(length=128), nullable=False),
|
||||
sa.Column('description', sa.Text(), nullable=False),
|
||||
sa.Column('gps_position', database.custom_types.Point(), nullable=True),
|
||||
sa.Column('gps_position', sa.Integer(), nullable=True),
|
||||
sa.Column('flight_id', sa.Integer(), nullable=False),
|
||||
sa.Column('created_by_id', sa.Integer(), nullable=False),
|
||||
sa.Column('created_at', sa.DateTime(), server_default=sa.text('now()'), nullable=False),
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
"""flight cover photo
|
||||
|
||||
Revision ID: 7304ac2f580b
|
||||
Revises: 419cf23cbf83
|
||||
Create Date: 2023-06-29 07:35:54.303608
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '7304ac2f580b'
|
||||
down_revision = '419cf23cbf83'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('flight', sa.Column('cover_photo_id', sa.Integer(), nullable=True))
|
||||
op.create_foreign_key(None, 'flight', 'photo', ['cover_photo_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', 'cover_photo_id')
|
||||
# ### end Alembic commands ###
|
||||
@@ -0,0 +1,56 @@
|
||||
"""zmena v gps, pridani poi_id do photo
|
||||
|
||||
Revision ID: ef51b2cd596a
|
||||
Revises: 7304ac2f580b
|
||||
Create Date: 2023-06-29 08:21:24.755261
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import mysql
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'ef51b2cd596a'
|
||||
down_revision = '7304ac2f580b'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('airport', sa.Column('gps_latitude', sa.Float(), nullable=True))
|
||||
op.add_column('airport', sa.Column('gps_longitude', sa.Float(), nullable=True))
|
||||
op.drop_column('airport', 'gps_position')
|
||||
op.add_column('flight_track', sa.Column('point_of_interest_id', sa.Integer(), nullable=False))
|
||||
op.drop_constraint('flight_track_ibfk_2', 'flight_track', type_='foreignkey')
|
||||
op.create_foreign_key(None, 'flight_track', 'point_of_interest', ['point_of_interest_id'], ['id'])
|
||||
op.drop_column('flight_track', 'poi_id')
|
||||
op.add_column('photo', sa.Column('gps_latitude', sa.Float(), nullable=True))
|
||||
op.add_column('photo', sa.Column('gps_longitude', sa.Float(), nullable=True))
|
||||
op.add_column('photo', sa.Column('poin_of_interest_id', sa.Integer(), nullable=True))
|
||||
op.create_foreign_key(None, 'photo', 'point_of_interest', ['poin_of_interest_id'], ['id'])
|
||||
op.drop_column('photo', 'gps_position')
|
||||
op.add_column('point_of_interest', sa.Column('gps_latitude', sa.Float(), nullable=True))
|
||||
op.add_column('point_of_interest', sa.Column('gps_longitude', sa.Float(), nullable=True))
|
||||
op.drop_column('point_of_interest', 'gps_position')
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('point_of_interest', sa.Column('gps_position', sa.NullType(), nullable=True))
|
||||
op.drop_column('point_of_interest', 'gps_longitude')
|
||||
op.drop_column('point_of_interest', 'gps_latitude')
|
||||
op.add_column('photo', sa.Column('gps_position', sa.NullType(), nullable=True))
|
||||
op.drop_constraint(None, 'photo', type_='foreignkey')
|
||||
op.drop_column('photo', 'poin_of_interest_id')
|
||||
op.drop_column('photo', 'gps_longitude')
|
||||
op.drop_column('photo', 'gps_latitude')
|
||||
op.add_column('flight_track', sa.Column('poi_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False))
|
||||
op.drop_constraint(None, 'flight_track', type_='foreignkey')
|
||||
op.create_foreign_key('flight_track_ibfk_2', 'flight_track', 'point_of_interest', ['poi_id'], ['id'])
|
||||
op.drop_column('flight_track', 'point_of_interest_id')
|
||||
op.add_column('airport', sa.Column('gps_position', sa.NullType(), nullable=True))
|
||||
op.drop_column('airport', 'gps_longitude')
|
||||
op.drop_column('airport', 'gps_latitude')
|
||||
# ### end Alembic commands ###
|
||||
@@ -0,0 +1,34 @@
|
||||
"""fix typo
|
||||
|
||||
Revision ID: 7dc6dd7d0f59
|
||||
Revises: ef51b2cd596a
|
||||
Create Date: 2023-06-29 15:43:44.520087
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import mysql
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '7dc6dd7d0f59'
|
||||
down_revision = 'ef51b2cd596a'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('photo', sa.Column('point_of_interest_id', sa.Integer(), nullable=True))
|
||||
op.drop_constraint('photo_ibfk_3', 'photo', type_='foreignkey')
|
||||
op.create_foreign_key(None, 'photo', 'point_of_interest', ['point_of_interest_id'], ['id'])
|
||||
op.drop_column('photo', 'poin_of_interest_id')
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('photo', sa.Column('poin_of_interest_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True))
|
||||
op.drop_constraint(None, 'photo', type_='foreignkey')
|
||||
op.create_foreign_key('photo_ibfk_3', 'photo', 'point_of_interest', ['poin_of_interest_id'], ['id'])
|
||||
op.drop_column('photo', 'point_of_interest_id')
|
||||
# ### end Alembic commands ###
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
"""uprava cover photo u letu, aircraft.call_sign
|
||||
|
||||
Revision ID: f19757a615cc
|
||||
Revises: 7dc6dd7d0f59
|
||||
Create Date: 2023-06-29 16:03:51.185228
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import mysql
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'f19757a615cc'
|
||||
down_revision = '7dc6dd7d0f59'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('aircraft', sa.Column('call_sign', sa.String(length=16), nullable=False))
|
||||
op.drop_column('aircraft', 'name')
|
||||
op.drop_constraint('flight_ibfk_6', 'flight', type_='foreignkey')
|
||||
op.drop_column('flight', 'cover_photo_id')
|
||||
op.add_column('photo', sa.Column('is_flight_cover', sa.Boolean(), server_default='0', nullable=False))
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column('photo', 'is_flight_cover')
|
||||
op.add_column('flight', sa.Column('cover_photo_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True))
|
||||
op.create_foreign_key('flight_ibfk_6', 'flight', 'photo', ['cover_photo_id'], ['id'])
|
||||
op.add_column('aircraft', sa.Column('name', mysql.VARCHAR(length=128), nullable=False))
|
||||
op.drop_column('aircraft', 'call_sign')
|
||||
# ### end Alembic commands ###
|
||||
Reference in New Issue
Block a user