Uklid v alembic migracich, error logging, upravy kvuli autorizaci
This commit is contained in:
@@ -1,34 +0,0 @@
|
||||
"""password len
|
||||
|
||||
Revision ID: 19ce22e5926b
|
||||
Revises: de421195d45c
|
||||
Create Date: 2023-05-06 21:01:42.983935
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import mysql
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '19ce22e5926b'
|
||||
down_revision = 'de421195d45c'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.alter_column('user', 'password_hashed',
|
||||
existing_type=mysql.VARCHAR(length=45),
|
||||
type_=sa.String(length=60),
|
||||
existing_nullable=False)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.alter_column('user', 'password_hashed',
|
||||
existing_type=sa.String(length=60),
|
||||
type_=mysql.VARCHAR(length=45),
|
||||
existing_nullable=False)
|
||||
# ### end Alembic commands ###
|
||||
@@ -1,28 +0,0 @@
|
||||
"""avatar url
|
||||
|
||||
Revision ID: 7951a7b79007
|
||||
Revises: 19ce22e5926b
|
||||
Create Date: 2023-05-07 21:42:58.261939
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '7951a7b79007'
|
||||
down_revision = '19ce22e5926b'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('user', sa.Column('avatar_image_url', sa.String(length=128), nullable=False))
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column('user', 'avatar_image_url')
|
||||
# ### end Alembic commands ###
|
||||
@@ -1,38 +0,0 @@
|
||||
"""edit
|
||||
|
||||
Revision ID: d15debffedf8
|
||||
Revises: 7951a7b79007
|
||||
Create Date: 2023-05-23 05:42:29.097139
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import mysql
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'd15debffedf8'
|
||||
down_revision = '7951a7b79007'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('aircraft', sa.Column('manufacturer', sa.Text(), server_default='', nullable=False))
|
||||
op.add_column('aircraft', sa.Column('model', sa.String(length=30), nullable=False))
|
||||
op.drop_column('aircraft', 'type')
|
||||
op.alter_column('user', 'avatar_image_url',
|
||||
existing_type=mysql.VARCHAR(length=128),
|
||||
nullable=True)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.alter_column('user', 'avatar_image_url',
|
||||
existing_type=mysql.VARCHAR(length=128),
|
||||
nullable=False)
|
||||
op.add_column('aircraft', sa.Column('type', mysql.VARCHAR(length=30), nullable=False))
|
||||
op.drop_column('aircraft', 'model')
|
||||
op.drop_column('aircraft', 'manufacturer')
|
||||
# ### end Alembic commands ###
|
||||
@@ -1,28 +0,0 @@
|
||||
"""edit
|
||||
|
||||
Revision ID: 8491bd15ab4a
|
||||
Revises: d15debffedf8
|
||||
Create Date: 2023-05-23 05:47:26.866008
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '8491bd15ab4a'
|
||||
down_revision = 'd15debffedf8'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('aircraft', sa.Column('deleted', sa.Boolean(), server_default='0', nullable=False))
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column('aircraft', 'deleted')
|
||||
# ### end Alembic commands ###
|
||||
@@ -1,28 +0,0 @@
|
||||
"""aircraft photo
|
||||
|
||||
Revision ID: 431adcd37681
|
||||
Revises: 8491bd15ab4a
|
||||
Create Date: 2023-05-31 20:18:02.644970
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '431adcd37681'
|
||||
down_revision = '8491bd15ab4a'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('aircraft', sa.Column('photo_filename', sa.String(length=128), nullable=True))
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column('aircraft', 'photo_filename')
|
||||
# ### end Alembic commands ###
|
||||
@@ -1,32 +0,0 @@
|
||||
"""flight edit
|
||||
|
||||
Revision ID: 66e39f31b1d2
|
||||
Revises: 431adcd37681
|
||||
Create Date: 2023-06-06 04:16:07.568446
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import mysql
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '66e39f31b1d2'
|
||||
down_revision = '431adcd37681'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('flight', sa.Column('takeoff_datetime', sa.DateTime(), nullable=False))
|
||||
op.add_column('flight', sa.Column('landing_datetime', sa.DateTime(), nullable=False))
|
||||
op.drop_column('flight', 'duration_total')
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('flight', sa.Column('duration_total', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False))
|
||||
op.drop_column('flight', 'landing_datetime')
|
||||
op.drop_column('flight', 'takeoff_datetime')
|
||||
# ### end Alembic commands ###
|
||||
@@ -1,32 +0,0 @@
|
||||
"""flight edit
|
||||
|
||||
Revision ID: 5781b1432475
|
||||
Revises: 66e39f31b1d2
|
||||
Create Date: 2023-06-06 04:35:10.408586
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '5781b1432475'
|
||||
down_revision = '66e39f31b1d2'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('flight', sa.Column('solo', sa.Boolean(), nullable=False))
|
||||
op.add_column('flight', sa.Column('with_instructor', sa.Boolean(), nullable=False))
|
||||
op.add_column('flight', sa.Column('landings', sa.Integer(), nullable=False))
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column('flight', 'landings')
|
||||
op.drop_column('flight', 'with_instructor')
|
||||
op.drop_column('flight', 'solo')
|
||||
# ### end Alembic commands ###
|
||||
@@ -1,34 +0,0 @@
|
||||
"""add soft delete
|
||||
|
||||
Revision ID: fd5fc5c1e2f6
|
||||
Revises: 5781b1432475
|
||||
Create Date: 2023-06-06 05:00:23.250817
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'fd5fc5c1e2f6'
|
||||
down_revision = '5781b1432475'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('copilot', sa.Column('deleted', sa.Boolean(), server_default='0', nullable=False))
|
||||
op.add_column('flight', sa.Column('deleted', sa.Boolean(), server_default='0', nullable=False))
|
||||
op.add_column('metar', sa.Column('deleted', sa.Boolean(), server_default='0', nullable=False))
|
||||
op.add_column('organization', sa.Column('deleted', sa.Boolean(), server_default='0', nullable=False))
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column('organization', 'deleted')
|
||||
op.drop_column('metar', 'deleted')
|
||||
op.drop_column('flight', 'deleted')
|
||||
op.drop_column('copilot', 'deleted')
|
||||
# ### end Alembic commands ###
|
||||
@@ -1,32 +0,0 @@
|
||||
"""add soft delete
|
||||
|
||||
Revision ID: 559795b043f3
|
||||
Revises: fd5fc5c1e2f6
|
||||
Create Date: 2023-06-06 05:00:51.512887
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '559795b043f3'
|
||||
down_revision = 'fd5fc5c1e2f6'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('airport', sa.Column('deleted', sa.Boolean(), server_default='0', nullable=False))
|
||||
op.add_column('point_of_interest', sa.Column('deleted', sa.Boolean(), server_default='0', nullable=False))
|
||||
op.add_column('point_of_interest_type', sa.Column('deleted', sa.Boolean(), server_default='0', nullable=False))
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column('point_of_interest_type', 'deleted')
|
||||
op.drop_column('point_of_interest', 'deleted')
|
||||
op.drop_column('airport', 'deleted')
|
||||
# ### end Alembic commands ###
|
||||
@@ -1,34 +0,0 @@
|
||||
"""flight duration
|
||||
|
||||
Revision ID: 419cf23cbf83
|
||||
Revises: 559795b043f3
|
||||
Create Date: 2023-06-06 17:41:26.375394
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import mysql
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '419cf23cbf83'
|
||||
down_revision = '559795b043f3'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('flight', sa.Column('duration_total', sa.Integer(), nullable=True))
|
||||
op.alter_column('flight', 'duration_pic',
|
||||
existing_type=mysql.INTEGER(display_width=11),
|
||||
nullable=True)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.alter_column('flight', 'duration_pic',
|
||||
existing_type=mysql.INTEGER(display_width=11),
|
||||
nullable=False)
|
||||
op.drop_column('flight', 'duration_total')
|
||||
# ### end Alembic commands ###
|
||||
@@ -1,30 +0,0 @@
|
||||
"""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 ###
|
||||
@@ -1,56 +0,0 @@
|
||||
"""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 ###
|
||||
@@ -1,34 +0,0 @@
|
||||
"""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
@@ -1,36 +0,0 @@
|
||||
"""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 ###
|
||||
@@ -1,32 +0,0 @@
|
||||
"""make poi type nullable
|
||||
|
||||
Revision ID: 804e55bbf855
|
||||
Revises: f19757a615cc
|
||||
Create Date: 2023-07-11 07:42:14.437885
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import mysql
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '804e55bbf855'
|
||||
down_revision = 'f19757a615cc'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.alter_column('point_of_interest', 'type_id',
|
||||
existing_type=mysql.INTEGER(display_width=11),
|
||||
nullable=True)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.alter_column('point_of_interest', 'type_id',
|
||||
existing_type=mysql.INTEGER(display_width=11),
|
||||
nullable=False)
|
||||
# ### end Alembic commands ###
|
||||
-40
@@ -1,40 +0,0 @@
|
||||
"""gps u letiste nejsou nullable, pridani sloupce photo.exposed_at
|
||||
|
||||
Revision ID: 708fc32f6a3b
|
||||
Revises: 804e55bbf855
|
||||
Create Date: 2023-07-31 04:51:26.257834
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import mysql
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '708fc32f6a3b'
|
||||
down_revision = '804e55bbf855'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.alter_column('airport', 'gps_latitude',
|
||||
existing_type=mysql.FLOAT(),
|
||||
nullable=False)
|
||||
op.alter_column('airport', 'gps_longitude',
|
||||
existing_type=mysql.FLOAT(),
|
||||
nullable=False)
|
||||
op.add_column('photo', sa.Column('exposed_at', sa.DateTime(), nullable=True))
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column('photo', 'exposed_at')
|
||||
op.alter_column('airport', 'gps_longitude',
|
||||
existing_type=mysql.FLOAT(),
|
||||
nullable=True)
|
||||
op.alter_column('airport', 'gps_latitude',
|
||||
existing_type=mysql.FLOAT(),
|
||||
nullable=True)
|
||||
# ### end Alembic commands ###
|
||||
@@ -1,28 +0,0 @@
|
||||
"""photo.gps_altitude
|
||||
|
||||
Revision ID: cf1fb904e9ab
|
||||
Revises: 708fc32f6a3b
|
||||
Create Date: 2023-07-31 08:57:10.715298
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'cf1fb904e9ab'
|
||||
down_revision = '708fc32f6a3b'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('photo', sa.Column('gps_altitude', sa.Float(), nullable=True))
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column('photo', 'gps_altitude')
|
||||
# ### end Alembic commands ###
|
||||
@@ -1,38 +0,0 @@
|
||||
"""add weather info
|
||||
|
||||
Revision ID: 36ea098fde31
|
||||
Revises: cf1fb904e9ab
|
||||
Create Date: 2023-08-01 04:37:17.188376
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '36ea098fde31'
|
||||
down_revision = 'cf1fb904e9ab'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('airport', sa.Column('created_by_id', sa.Integer(), nullable=True))
|
||||
op.create_foreign_key(None, 'airport', 'user', ['created_by_id'], ['id'])
|
||||
op.add_column('flight', sa.Column('weather_info_takeoff_id', sa.Integer(), nullable=True))
|
||||
op.add_column('flight', sa.Column('weather_info_landing_id', sa.Integer(), nullable=True))
|
||||
op.create_foreign_key(None, 'flight', 'weather_info', ['weather_info_takeoff_id'], ['id'])
|
||||
op.create_foreign_key(None, 'flight', 'weather_info', ['weather_info_landing_id'], ['id'])
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_constraint('flight_ibfk_6', 'flight', type_='foreignkey')
|
||||
op.drop_constraint('flight_ibfk_7', 'flight', type_='foreignkey')
|
||||
op.drop_column('flight', 'weather_info_landing_id')
|
||||
op.drop_column('flight', 'weather_info_takeoff_id')
|
||||
op.drop_constraint('airport_ibfk_1', 'airport', type_='foreignkey')
|
||||
op.drop_column('airport', 'created_by_id')
|
||||
# ### end Alembic commands ###
|
||||
@@ -1,28 +0,0 @@
|
||||
"""add datetime to weather_info
|
||||
|
||||
Revision ID: 2a320e1e093d
|
||||
Revises: 36ea098fde31
|
||||
Create Date: 2023-08-01 04:47:22.122423
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import mysql
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '2a320e1e093d'
|
||||
down_revision = '36ea098fde31'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('weather_info', sa.Column('datetime', sa.DateTime(), nullable=False))
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column('weather_info', 'datetime')
|
||||
# ### end Alembic commands ###
|
||||
@@ -1,28 +0,0 @@
|
||||
"""add gpx to flight
|
||||
|
||||
Revision ID: 1e04cd7838dd
|
||||
Revises: 2a320e1e093d
|
||||
Create Date: 2023-08-07 18:55:00.914684
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '1e04cd7838dd'
|
||||
down_revision = '2a320e1e093d'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('flight', sa.Column('gpx_track_filename', sa.String(length=128), nullable=True))
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column('flight', 'gpx_track_filename')
|
||||
# ### end Alembic commands ###
|
||||
@@ -1,38 +0,0 @@
|
||||
"""airports cannot be nullable
|
||||
|
||||
Revision ID: f85556b2ce2c
|
||||
Revises: 1e04cd7838dd
|
||||
Create Date: 2023-08-07 19:14:17.791435
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import mysql
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'f85556b2ce2c'
|
||||
down_revision = '1e04cd7838dd'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.alter_column('flight', 'takeoff_airport_id',
|
||||
existing_type=mysql.INTEGER(display_width=11),
|
||||
nullable=False)
|
||||
op.alter_column('flight', 'landing_airport_id',
|
||||
existing_type=mysql.INTEGER(display_width=11),
|
||||
nullable=False)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.alter_column('flight', 'landing_airport_id',
|
||||
existing_type=mysql.INTEGER(display_width=11),
|
||||
nullable=True)
|
||||
op.alter_column('flight', 'takeoff_airport_id',
|
||||
existing_type=mysql.INTEGER(display_width=11),
|
||||
nullable=True)
|
||||
# ### end Alembic commands ###
|
||||
@@ -1,30 +0,0 @@
|
||||
"""remove not used fields in flight
|
||||
|
||||
Revision ID: b5c66e5a2df7
|
||||
Revises: f85556b2ce2c
|
||||
Create Date: 2023-08-07 20:53:00.717813
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import mysql
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'b5c66e5a2df7'
|
||||
down_revision = 'f85556b2ce2c'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column('flight', 'with_instructor')
|
||||
op.drop_column('flight', 'solo')
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('flight', sa.Column('solo', mysql.TINYINT(display_width=1), autoincrement=False, nullable=False))
|
||||
op.add_column('flight', sa.Column('with_instructor', mysql.TINYINT(display_width=1), autoincrement=False, nullable=False))
|
||||
# ### end Alembic commands ###
|
||||
@@ -1,28 +0,0 @@
|
||||
"""add title photo url for user
|
||||
|
||||
Revision ID: b1bd8ecc3251
|
||||
Revises: b5c66e5a2df7
|
||||
Create Date: 2023-08-08 19:08:13.021213
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'b1bd8ecc3251'
|
||||
down_revision = 'b5c66e5a2df7'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('user', sa.Column('title_image_url', sa.String(length=128), nullable=True))
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column('user', 'title_image_url')
|
||||
# ### end Alembic commands ###
|
||||
@@ -1,34 +0,0 @@
|
||||
"""rename images in user table
|
||||
|
||||
Revision ID: 3d51075b5ece
|
||||
Revises: b1bd8ecc3251
|
||||
Create Date: 2023-08-08 19:45:21.470315
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import mysql
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '3d51075b5ece'
|
||||
down_revision = 'b1bd8ecc3251'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('user', sa.Column('avatar_image_filename', sa.String(length=128), nullable=True))
|
||||
op.add_column('user', sa.Column('title_image_filename', sa.String(length=128), nullable=True))
|
||||
op.drop_column('user', 'title_image_url')
|
||||
op.drop_column('user', 'avatar_image_url')
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('user', sa.Column('avatar_image_url', mysql.VARCHAR(length=128), nullable=True))
|
||||
op.add_column('user', sa.Column('title_image_url', mysql.VARCHAR(length=128), nullable=True))
|
||||
op.drop_column('user', 'title_image_filename')
|
||||
op.drop_column('user', 'avatar_image_filename')
|
||||
# ### end Alembic commands ###
|
||||
@@ -1,32 +0,0 @@
|
||||
"""add public info to user
|
||||
|
||||
Revision ID: 707eb800ddcd
|
||||
Revises: 3d51075b5ece
|
||||
Create Date: 2023-08-08 20:24:32.728653
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '707eb800ddcd'
|
||||
down_revision = '3d51075b5ece'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('user', sa.Column('description', sa.Text(), nullable=False))
|
||||
op.add_column('user', sa.Column('public_username', sa.String(length=128), nullable=True))
|
||||
op.create_unique_constraint(None, 'user', ['public_username'])
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_constraint(None, 'user', type_='unique')
|
||||
op.drop_column('user', 'public_username')
|
||||
op.drop_column('user', 'description')
|
||||
# ### end Alembic commands ###
|
||||
@@ -1,28 +0,0 @@
|
||||
"""add is_public to flight
|
||||
|
||||
Revision ID: 300b721e0818
|
||||
Revises: 707eb800ddcd
|
||||
Create Date: 2023-08-08 22:08:34.559165
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '300b721e0818'
|
||||
down_revision = '707eb800ddcd'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('flight', sa.Column('is_public', sa.Boolean(), server_default='0', nullable=False))
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column('flight', 'is_public')
|
||||
# ### end Alembic commands ###
|
||||
+87
-37
@@ -1,15 +1,16 @@
|
||||
"""first db version
|
||||
"""initial DB schema
|
||||
|
||||
Revision ID: de421195d45c
|
||||
Revision ID: dd48d8dab743
|
||||
Revises:
|
||||
Create Date: 2023-05-06 20:57:49.053470
|
||||
Create Date: 2023-08-14 10:08:06.796608
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'de421195d45c'
|
||||
revision = 'dd48d8dab743'
|
||||
down_revision = None
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
@@ -17,29 +18,53 @@ depends_on = None
|
||||
|
||||
def upgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('airport',
|
||||
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', 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')
|
||||
)
|
||||
op.create_table('user',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('email', sa.String(length=128), nullable=False),
|
||||
sa.Column('name', sa.String(length=128), nullable=False),
|
||||
sa.Column('password_hashed', sa.String(length=45), nullable=False),
|
||||
sa.Column('description', sa.Text(), nullable=False),
|
||||
sa.Column('public_username', sa.String(length=128), nullable=True),
|
||||
sa.Column('avatar_image_filename', sa.String(length=128), nullable=True),
|
||||
sa.Column('title_image_filename', sa.String(length=128), nullable=True),
|
||||
sa.Column('password_hashed', sa.String(length=60), nullable=False),
|
||||
sa.Column('created_at', sa.DateTime(), server_default=sa.text('now()'), nullable=False),
|
||||
sa.PrimaryKeyConstraint('id'),
|
||||
sa.UniqueConstraint('email')
|
||||
sa.UniqueConstraint('email'),
|
||||
sa.UniqueConstraint('public_username')
|
||||
)
|
||||
op.create_table('weather_info',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('qnh', sa.Integer(), nullable=True),
|
||||
sa.Column('temperature_surface', sa.Float(), nullable=True),
|
||||
sa.Column('dewpoint_surface', sa.Float(), nullable=True),
|
||||
sa.Column('rain', sa.Float(), nullable=True),
|
||||
sa.Column('cloudcover_low', sa.Float(), nullable=True),
|
||||
sa.Column('cloudcover_total', sa.Float(), nullable=True),
|
||||
sa.Column('wind_speed_surface', sa.Float(), nullable=True),
|
||||
sa.Column('wind_direction_surface', sa.Float(), nullable=True),
|
||||
sa.Column('datetime', sa.DateTime(), nullable=False),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
op.create_table('airport',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('name', sa.String(length=128), nullable=False),
|
||||
sa.Column('icao_code', sa.String(length=8), nullable=False),
|
||||
sa.Column('gps_latitude', sa.Float(), nullable=False),
|
||||
sa.Column('gps_longitude', sa.Float(), nullable=False),
|
||||
sa.Column('elevation', sa.Integer(), nullable=True),
|
||||
sa.Column('is_public', sa.Boolean(), server_default='0', nullable=False),
|
||||
sa.Column('created_at', sa.DateTime(), server_default=sa.text('now()'), nullable=False),
|
||||
sa.Column('created_by_id', sa.Integer(), nullable=True),
|
||||
sa.Column('deleted', sa.Boolean(), server_default='0', nullable=False),
|
||||
sa.ForeignKeyConstraint(['created_by_id'], ['user.id'], ),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
op.create_table('copilot',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('name', sa.String(length=128), nullable=False),
|
||||
sa.Column('created_by_id', sa.Integer(), nullable=False),
|
||||
sa.Column('created_at', sa.DateTime(), server_default=sa.text('now()'), nullable=False),
|
||||
sa.Column('deleted', sa.Boolean(), server_default='0', nullable=False),
|
||||
sa.ForeignKeyConstraint(['created_by_id'], ['user.id'], ),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
@@ -53,19 +78,12 @@ def upgrade() -> None:
|
||||
sa.ForeignKeyConstraint(['created_by_id'], ['user.id'], ),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
op.create_table('metar',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('airport_id', sa.Integer(), nullable=False),
|
||||
sa.Column('metar', sa.Text(), nullable=False),
|
||||
sa.Column('issued_at', sa.DateTime(), nullable=False),
|
||||
sa.ForeignKeyConstraint(['airport_id'], ['airport.id'], ),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
op.create_table('organization',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('name', sa.String(length=128), nullable=False),
|
||||
sa.Column('created_by_id', sa.Integer(), nullable=False),
|
||||
sa.Column('created_at', sa.DateTime(), server_default=sa.text('now()'), nullable=False),
|
||||
sa.Column('deleted', sa.Boolean(), server_default='0', nullable=False),
|
||||
sa.ForeignKeyConstraint(['created_by_id'], ['user.id'], ),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
@@ -75,29 +93,44 @@ def upgrade() -> None:
|
||||
sa.Column('is_public', sa.Boolean(), server_default='0', nullable=False),
|
||||
sa.Column('created_by_id', sa.Integer(), nullable=False),
|
||||
sa.Column('created_at', sa.DateTime(), server_default=sa.text('now()'), nullable=False),
|
||||
sa.Column('deleted', sa.Boolean(), server_default='0', nullable=False),
|
||||
sa.ForeignKeyConstraint(['created_by_id'], ['user.id'], ),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
op.create_table('aircraft',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('name', sa.String(length=128), nullable=False),
|
||||
sa.Column('type', sa.String(length=30), nullable=False),
|
||||
sa.Column('description', sa.Text(), nullable=False),
|
||||
sa.Column('call_sign', sa.String(length=16), nullable=False),
|
||||
sa.Column('photo_filename', sa.String(length=128), nullable=True),
|
||||
sa.Column('manufacturer', sa.Text(), server_default='', nullable=False),
|
||||
sa.Column('model', sa.String(length=30), server_default='', nullable=False),
|
||||
sa.Column('description', sa.Text(), server_default='', nullable=False),
|
||||
sa.Column('organization_id', sa.Integer(), nullable=True),
|
||||
sa.Column('created_by_id', sa.Integer(), nullable=False),
|
||||
sa.Column('created_at', sa.DateTime(), server_default=sa.text('now()'), nullable=False),
|
||||
sa.Column('deleted', sa.Boolean(), server_default='0', nullable=False),
|
||||
sa.ForeignKeyConstraint(['created_by_id'], ['user.id'], ),
|
||||
sa.ForeignKeyConstraint(['organization_id'], ['organization.id'], ),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
op.create_table('metar',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('airport_id', sa.Integer(), nullable=False),
|
||||
sa.Column('metar', sa.Text(), nullable=False),
|
||||
sa.Column('issued_at', sa.DateTime(), nullable=False),
|
||||
sa.Column('deleted', sa.Boolean(), server_default='0', nullable=False),
|
||||
sa.ForeignKeyConstraint(['airport_id'], ['airport.id'], ),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
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', sa.Integer(), nullable=True),
|
||||
sa.Column('type_id', sa.Integer(), nullable=False),
|
||||
sa.Column('gps_latitude', sa.Float(), nullable=True),
|
||||
sa.Column('gps_longitude', sa.Float(), nullable=True),
|
||||
sa.Column('type_id', sa.Integer(), nullable=True),
|
||||
sa.Column('is_public', sa.Boolean(), server_default='0', nullable=False),
|
||||
sa.Column('created_by_id', sa.Integer(), nullable=False),
|
||||
sa.Column('created_at', sa.DateTime(), server_default=sa.text('now()'), nullable=False),
|
||||
sa.Column('deleted', sa.Boolean(), server_default='0', nullable=False),
|
||||
sa.ForeignKeyConstraint(['created_by_id'], ['user.id'], ),
|
||||
sa.ForeignKeyConstraint(['type_id'], ['point_of_interest_type.id'], ),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
@@ -125,41 +158,57 @@ def upgrade() -> None:
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('name', sa.String(length=128), nullable=False),
|
||||
sa.Column('description', sa.Text(), nullable=False),
|
||||
sa.Column('takeoff_airport_id', sa.Integer(), nullable=True),
|
||||
sa.Column('landing_airport_id', sa.Integer(), nullable=True),
|
||||
sa.Column('takeoff_airport_id', sa.Integer(), nullable=False),
|
||||
sa.Column('landing_airport_id', sa.Integer(), nullable=False),
|
||||
sa.Column('takeoff_datetime', sa.DateTime(), nullable=False),
|
||||
sa.Column('landing_datetime', sa.DateTime(), nullable=False),
|
||||
sa.Column('duration_total', sa.Integer(), nullable=True),
|
||||
sa.Column('duration_pic', sa.Integer(), nullable=True),
|
||||
sa.Column('gpx_track_filename', sa.String(length=128), nullable=True),
|
||||
sa.Column('aircraft_id', sa.Integer(), nullable=False),
|
||||
sa.Column('copilot_id', sa.Integer(), nullable=True),
|
||||
sa.Column('weather_info_takeoff_id', sa.Integer(), nullable=True),
|
||||
sa.Column('weather_info_landing_id', sa.Integer(), nullable=True),
|
||||
sa.Column('landings', sa.Integer(), nullable=False),
|
||||
sa.Column('is_public', sa.Boolean(), server_default='0', nullable=False),
|
||||
sa.Column('created_by_id', sa.Integer(), nullable=False),
|
||||
sa.Column('created_at', sa.DateTime(), server_default=sa.text('now()'), nullable=False),
|
||||
sa.Column('duration_total', sa.Integer(), nullable=False),
|
||||
sa.Column('duration_pic', sa.Integer(), nullable=False),
|
||||
sa.Column('deleted', sa.Boolean(), server_default='0', nullable=False),
|
||||
sa.ForeignKeyConstraint(['aircraft_id'], ['aircraft.id'], ),
|
||||
sa.ForeignKeyConstraint(['copilot_id'], ['copilot.id'], ),
|
||||
sa.ForeignKeyConstraint(['created_by_id'], ['user.id'], ),
|
||||
sa.ForeignKeyConstraint(['landing_airport_id'], ['airport.id'], ),
|
||||
sa.ForeignKeyConstraint(['takeoff_airport_id'], ['airport.id'], ),
|
||||
sa.ForeignKeyConstraint(['weather_info_landing_id'], ['weather_info.id'], ),
|
||||
sa.ForeignKeyConstraint(['weather_info_takeoff_id'], ['weather_info.id'], ),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
op.create_table('flight_track',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('flight_id', sa.Integer(), nullable=False),
|
||||
sa.Column('poi_id', sa.Integer(), nullable=False),
|
||||
sa.Column('point_of_interest_id', sa.Integer(), nullable=False),
|
||||
sa.Column('order', sa.Integer(), nullable=False),
|
||||
sa.ForeignKeyConstraint(['flight_id'], ['flight.id'], ),
|
||||
sa.ForeignKeyConstraint(['poi_id'], ['point_of_interest.id'], ),
|
||||
sa.ForeignKeyConstraint(['point_of_interest_id'], ['point_of_interest.id'], ),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
op.create_table('photo',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('name', sa.String(length=128), nullable=False),
|
||||
sa.Column('filename', sa.String(length=128), nullable=False),
|
||||
sa.Column('is_flight_cover', sa.Boolean(), server_default='0', nullable=False),
|
||||
sa.Column('description', sa.Text(), nullable=False),
|
||||
sa.Column('gps_position', sa.Integer(), nullable=True),
|
||||
sa.Column('exposed_at', sa.DateTime(), nullable=True),
|
||||
sa.Column('gps_latitude', sa.Float(), nullable=True),
|
||||
sa.Column('gps_longitude', sa.Float(), nullable=True),
|
||||
sa.Column('gps_altitude', sa.Float(), nullable=True),
|
||||
sa.Column('point_of_interest_id', 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),
|
||||
sa.ForeignKeyConstraint(['created_by_id'], ['user.id'], ),
|
||||
sa.ForeignKeyConstraint(['flight_id'], ['flight.id'], ),
|
||||
sa.ForeignKeyConstraint(['point_of_interest_id'], ['point_of_interest.id'], ),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
# ### end Alembic commands ###
|
||||
@@ -173,12 +222,13 @@ def downgrade() -> None:
|
||||
op.drop_table('aircraft_notes')
|
||||
op.drop_table('user_is_in_organization')
|
||||
op.drop_table('point_of_interest')
|
||||
op.drop_table('metar')
|
||||
op.drop_table('aircraft')
|
||||
op.drop_table('point_of_interest_type')
|
||||
op.drop_table('organization')
|
||||
op.drop_table('metar')
|
||||
op.drop_table('license')
|
||||
op.drop_table('copilot')
|
||||
op.drop_table('user')
|
||||
op.drop_table('airport')
|
||||
op.drop_table('weather_info')
|
||||
op.drop_table('user')
|
||||
# ### end Alembic commands ###
|
||||
Reference in New Issue
Block a user