Hromada uprav kvuli ssr renderu a verejne casti

This commit is contained in:
Michal Kváček
2023-12-04 22:45:44 +01:00
parent ecb37fb961
commit 3167ea2f8a
19 changed files with 334 additions and 90 deletions
@@ -0,0 +1,50 @@
"""add photos to aircraft, poi and copilots
Revision ID: 91a9608b509d
Revises: d42172840f6c
Create Date: 2023-11-28 16:32:56.725312
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '91a9608b509d'
down_revision = 'd42172840f6c'
branch_labels = None
depends_on = None
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('copilot_has_photo',
sa.Column('copilot_id', sa.Integer(), nullable=False),
sa.Column('photo_id', sa.Integer(), nullable=False),
sa.ForeignKeyConstraint(['copilot_id'], ['copilot.id'], ),
sa.ForeignKeyConstraint(['photo_id'], ['photo.id'], ),
sa.PrimaryKeyConstraint('copilot_id', 'photo_id')
)
op.add_column('aircraft', sa.Column('title_photo_id', sa.Integer(), nullable=True))
op.create_foreign_key(None, 'aircraft', 'photo', ['title_photo_id'], ['id'])
op.add_column('flight', sa.Column('title_photo_id', sa.Integer(), nullable=True))
op.create_foreign_key(None, 'flight', 'photo', ['title_photo_id'], ['id'])
op.add_column('photo', sa.Column('aircraft_id', sa.Integer(), nullable=True))
op.create_foreign_key(None, 'photo', 'aircraft', ['aircraft_id'], ['id'])
op.add_column('point_of_interest', sa.Column('title_photo_id', sa.Integer(), nullable=True))
op.create_foreign_key(None, 'point_of_interest', 'photo', ['title_photo_id'], ['id'])
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.drop_constraint(None, 'point_of_interest', type_='foreignkey')
op.drop_column('point_of_interest', 'title_photo_id')
op.drop_constraint(None, 'photo', type_='foreignkey')
op.drop_column('photo', 'aircraft_id')
op.drop_constraint(None, 'flight', type_='foreignkey')
op.drop_column('flight', 'title_photo_id')
op.drop_constraint(None, 'aircraft', type_='foreignkey')
op.drop_column('aircraft', 'title_photo_id')
op.drop_table('copilot_has_photo')
# ### end Alembic commands ###
@@ -0,0 +1,28 @@
"""add is_public to aircraft
Revision ID: e5682ac4355c
Revises: 91a9608b509d
Create Date: 2023-12-02 12:14:25.055308
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'e5682ac4355c'
down_revision = '91a9608b509d'
branch_labels = None
depends_on = None
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('aircraft', 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('aircraft', 'is_public')
# ### end Alembic commands ###
@@ -0,0 +1,30 @@
"""add title photo to copilot
Revision ID: 022bf6fbcd47
Revises: e5682ac4355c
Create Date: 2023-12-02 13:05:46.267006
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '022bf6fbcd47'
down_revision = 'e5682ac4355c'
branch_labels = None
depends_on = None
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('copilot', sa.Column('title_photo_id', sa.Integer(), nullable=True))
op.create_foreign_key(None, 'copilot', 'photo', ['title_photo_id'], ['id'])
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.drop_constraint(None, 'copilot', type_='foreignkey')
op.drop_column('copilot', 'title_photo_id')
# ### end Alembic commands ###