Skip to content

Commit

Permalink
Fix pointing directly to SA_columns
Browse files Browse the repository at this point in the history
  • Loading branch information
ARodenboog committed Jun 4, 2024
1 parent 5632c83 commit 794de34
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sqlmodel_celery_beat/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
)
from pydantic import ValidationError, root_validator, validator
import sqlalchemy as sa
from sqlalchemy import TIMESTAMP
from sqlalchemy.event import listen
from sqlmodel import Relationship, SQLModel, Field, Session, select
from celery import schedules
Expand All @@ -30,11 +31,11 @@ class ModelMixin(SQLModel):

id: int = Field(primary_key=True)
created_at: datetime = Field(
sa_column=sa.Column(sa.DateTime(timezone=True), nullable=False),
sa_type=TIMESTAMP(timezone=True),
default=nowfun(),
)
updated_at: datetime = Field(
sa_column=sa.Column(sa.DateTime(timezone=True), nullable=False),
sa_type=TIMESTAMP(timezone=True),
default_factory=nowfun,
)

Expand Down

0 comments on commit 794de34

Please sign in to comment.