🐛 Fix models default value

This commit is contained in:
xtaodada 2024-12-01 22:40:12 +08:00
parent 4af2cab246
commit 30c1a38c4a
Signed by: xtaodada
GPG Key ID: 4CBB3F4FA8C85659
2 changed files with 5 additions and 5 deletions

View File

@ -12,10 +12,10 @@ class AnswerDB(SQLModel, table=True):
id: Optional[int] = Field(default=None, sa_column=Column(Integer, primary_key=True, autoincrement=True))
question_id: Optional[int] = Field(
sa_column=Column(Integer, ForeignKey("question.id", ondelete="RESTRICT", onupdate="RESTRICT"))
default=None, sa_column=Column(Integer, ForeignKey("question.id", ondelete="RESTRICT", onupdate="RESTRICT"))
)
is_correct: Optional[bool] = Field()
text: Optional[str] = Field()
is_correct: Optional[bool] = Field(default=None)
text: Optional[str] = Field(default=None)
class QuestionDB(SQLModel, table=True):
@ -23,7 +23,7 @@ class QuestionDB(SQLModel, table=True):
__table_args__ = dict(mysql_charset="utf8mb4", mysql_collate="utf8mb4_general_ci")
id: Optional[int] = Field(default=None, sa_column=Column(Integer, primary_key=True, autoincrement=True))
text: Optional[str] = Field()
text: Optional[str] = Field(default=None)
class Answer(BaseModel):

@ -1 +1 @@
Subproject commit bf5b153001defd150d4dcc17b9baf06a3769adf0
Subproject commit d10f0d4815d70804ea38686346671d230b7ab84c