eventcally/migrations/versions/fd7794ece0b3_.py
Daniel Grams d63f340384 Internal/modules (#1)
* Restructured app
* Added Travis CI
* Added 'Deploy to heroku' button
2020-11-13 12:24:26 +01:00

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 ###