changed date

This commit is contained in:
Philip Cheung 2024-10-07 14:39:56 +08:00
parent 050209eb9d
commit 1ac60d3c49
2 changed files with 31 additions and 2 deletions

View File

@ -0,0 +1,29 @@
"""changed date
Revision ID: 691c39dbac74
Revises: 94afd163eba3
Create Date: 2024-10-07 14:38:57.274294
"""
from alembic import op
import sqlalchemy as sa
import sqlmodel.sql.sqltypes
# revision identifiers, used by Alembic.
revision = '691c39dbac74'
down_revision = '94afd163eba3'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@ -124,7 +124,7 @@ class MessageBase(SQLModel):
class Message(MessageBase, table=True):
id: uuid.UUID = Field(default_factory=uuid.uuid4, primary_key=True)
created_at: datetime = Field(default_factory=datetime.utcnow)
created_at: datetime = Field(default_factory=datetime.now)
class MessageCreate(MessageBase):
pass
@ -201,7 +201,7 @@ class CourseUpdate(CourseBase):
class Course(CourseBase, table=True):
id: uuid.UUID = Field(default_factory=uuid.uuid4, primary_key=True)
created_at: datetime = Field(default_factory=datetime.utcnow)
created_at: datetime = Field(default_factory=datetime.now)
images: list["Image"] = Relationship(back_populates="course", cascade_delete=True)
info_images: list["Info_Image"] = Relationship(back_populates="course", cascade_delete=True)
schedule: list["Schedule"] = Relationship(back_populates="course", cascade_delete=True)