33 lines
1.0 KiB
Python
33 lines
1.0 KiB
Python
"""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 ###
|