eventcally/migrations/versions/7afc40e11791_.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

45 lines
1.5 KiB
Python

"""empty message
Revision ID: 7afc40e11791
Revises: a8c662c46047
Create Date: 2020-09-28 10:38:46.424791
"""
from alembic import op
import sqlalchemy as sa
import sqlalchemy_utils
from project import dbtypes
from project.models import FeaturedEventRejectionReason, FeaturedEventReviewStatus
# revision identifiers, used by Alembic.
revision = '7afc40e11791'
down_revision = 'a8c662c46047'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('featuredevent',
sa.Column('created_at', sa.DateTime(), nullable=True),
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('event_id', sa.Integer(), nullable=False),
sa.Column('review_status', dbtypes.IntegerEnum(FeaturedEventReviewStatus), nullable=True),
sa.Column('rejection_resaon', dbtypes.IntegerEnum(FeaturedEventRejectionReason), nullable=True),
sa.Column('rating', sa.Integer(), nullable=True),
sa.Column('created_by_id', sa.Integer(), nullable=True),
sa.ForeignKeyConstraint(['created_by_id'], ['user.id'], ),
sa.ForeignKeyConstraint(['event_id'], ['event.id'], ),
sa.PrimaryKeyConstraint('id')
)
op.add_column('event', sa.Column('rating', sa.Integer(), nullable=True))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('event', 'rating')
op.drop_table('featuredevent')
# ### end Alembic commands ###