🐛 Converted string to text for quiz-description and title
This commit is contained in:
@@ -127,8 +127,8 @@ class QuizInput(BaseModel):
|
|||||||
class Quiz(ormar.Model):
|
class Quiz(ormar.Model):
|
||||||
id: uuid.UUID = ormar.UUID(primary_key=True, default=uuid.uuid4(), nullable=False, unique=True)
|
id: uuid.UUID = ormar.UUID(primary_key=True, default=uuid.uuid4(), nullable=False, unique=True)
|
||||||
public: bool = ormar.Boolean(default=False)
|
public: bool = ormar.Boolean(default=False)
|
||||||
title: str = ormar.String(max_length=100)
|
title: str = ormar.Text()
|
||||||
description: str = ormar.String(max_length=300, nullable=True)
|
description: str = ormar.Text(nullable=True)
|
||||||
created_at: datetime = ormar.DateTime(default=datetime.now())
|
created_at: datetime = ormar.DateTime(default=datetime.now())
|
||||||
updated_at: datetime = ormar.DateTime(default=datetime.now())
|
updated_at: datetime = ormar.DateTime(default=datetime.now())
|
||||||
user_id: uuid.UUID = ormar.ForeignKey(User)
|
user_id: uuid.UUID = ormar.ForeignKey(User)
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
"""Made title and description be text not string
|
||||||
|
|
||||||
|
Revision ID: b2acaede5c2f
|
||||||
|
Revises: 400f8ed06c48
|
||||||
|
Create Date: 2022-12-17 11:31:42.036454
|
||||||
|
|
||||||
|
"""
|
||||||
|
from alembic import op
|
||||||
|
import sqlalchemy as sa
|
||||||
|
import ormar
|
||||||
|
|
||||||
|
|
||||||
|
# revision identifiers, used by Alembic.
|
||||||
|
revision = "b2acaede5c2f"
|
||||||
|
down_revision = "400f8ed06c48"
|
||||||
|
branch_labels = None
|
||||||
|
depends_on = None
|
||||||
|
|
||||||
|
|
||||||
|
def upgrade() -> None:
|
||||||
|
op.alter_column("quiz", "title", type_=sa.Text)
|
||||||
|
op.alter_column("quiz", "description", type_=sa.Text)
|
||||||
|
|
||||||
|
|
||||||
|
def downgrade() -> None:
|
||||||
|
op.alter_column("quiz", "title", type_=sa.String)
|
||||||
|
op.alter_column("quiz", "description", type_=sa.String)
|
||||||
Reference in New Issue
Block a user