mirror of
https://github.com/lucaspalomodevelop/eventcally.git
synced 2026-03-13 00:07:22 +00:00
48 lines
1.6 KiB
Python
48 lines
1.6 KiB
Python
"""empty message
|
|
|
|
Revision ID: fd7794ece0b3
|
|
Revises: 975c22ae802b
|
|
Create Date: 2020-07-17 19:51:08.457429
|
|
|
|
"""
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
import sqlalchemy_utils
|
|
from project import dbtypes
|
|
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = 'fd7794ece0b3'
|
|
down_revision = '975c22ae802b'
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.create_table('eventplace',
|
|
sa.Column('created_at', sa.DateTime(), nullable=True),
|
|
sa.Column('id', sa.Integer(), nullable=False),
|
|
sa.Column('name', sa.Unicode(length=255), nullable=False),
|
|
sa.Column('location_id', sa.Integer(), nullable=True),
|
|
sa.Column('photo_id', sa.Integer(), nullable=True),
|
|
sa.Column('url', sa.String(length=255), nullable=True),
|
|
sa.Column('description', sa.UnicodeText(), nullable=True),
|
|
sa.Column('created_by_id', sa.Integer(), nullable=True),
|
|
sa.ForeignKeyConstraint(['created_by_id'], ['user.id'], ),
|
|
sa.ForeignKeyConstraint(['location_id'], ['location.id'], ),
|
|
sa.ForeignKeyConstraint(['photo_id'], ['image.id'], ),
|
|
sa.PrimaryKeyConstraint('id')
|
|
)
|
|
op.add_column('event', sa.Column('event_place_id', sa.Integer(), nullable=True))
|
|
op.create_foreign_key(None, 'event', 'place', ['event_place_id'], ['id'])
|
|
# ### end Alembic commands ###
|
|
|
|
|
|
def downgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.drop_constraint(None, 'event', type_='foreignkey')
|
|
op.drop_column('event', 'event_place_id')
|
|
op.drop_table('eventplace')
|
|
# ### end Alembic commands ###
|