diff --git a/backend/app/alembic/versions/691c39dbac74_changed_date.py b/backend/app/alembic/versions/691c39dbac74_changed_date.py new file mode 100644 index 0000000..8d199a1 --- /dev/null +++ b/backend/app/alembic/versions/691c39dbac74_changed_date.py @@ -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 ### diff --git a/backend/app/models.py b/backend/app/models.py index 1cb1740..e5c4f77 100644 --- a/backend/app/models.py +++ b/backend/app/models.py @@ -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)