Files
classquiz-ai/migrations/versions/4bbe1850b61a_added_1.py
T
2023-06-30 13:16:12 +02:00

43 lines
1.2 KiB
Python

# SPDX-FileCopyrightText: 2023 Marlon W (Mawoka)
#
# SPDX-License-Identifier: MPL-2.0
"""Added #1
Revision ID: 4bbe1850b61a
Revises: 7afe98d04169
Create Date: 2023-04-29 21:33:22.657554
"""
from alembic import op
import sqlalchemy as sa
import ormar
# revision identifiers, used by Alembic.
revision = "4bbe1850b61a"
down_revision = "7afe98d04169"
branch_labels = None
depends_on = None
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.create_table(
"quiztivitys",
sa.Column("id", ormar.fields.sqlalchemy_uuid.CHAR(32), nullable=False),
sa.Column("title", sa.Text(), nullable=False),
sa.Column("created_at", sa.DateTime(), server_default=sa.text("now()"), nullable=False),
sa.Column("user", ormar.fields.sqlalchemy_uuid.CHAR(32), nullable=True),
sa.Column("pages", sa.JSON(), nullable=False),
sa.ForeignKeyConstraint(["user"], ["users.id"], name="fk_quiztivitys_users_id_user"),
sa.PrimaryKeyConstraint("id"),
)
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table("quiztivitys")
# ### end Alembic commands ###