eventcally/migrations/versions/7afc40e11791_.py
Daniel Grams 273b3fb072 Internal/analysis (#4)
* Codestyle Black

* Flake8

* Test coverage
2020-11-13 23:05:39 +01:00

59 lines
1.6 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
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 ###