Skip to content

Commit da7238b

Browse files
committed
♻️ Update created_at
1 parent 5c1576a commit da7238b

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

backend/app/alembic/versions/44fc2bbcc925_add_created_at_to_user_and_item.py renamed to backend/app/alembic/versions/fe56fa70289e_add_created_at_to_user_and_item.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
"""Add created_at to User and Item
22
3-
Revision ID: 44fc2bbcc925
3+
Revision ID: fe56fa70289e
44
Revises: 1a31ce608336
5-
Create Date: 2026-01-23 15:42:52.493895
5+
Create Date: 2026-01-23 15:50:37.171462
66
77
"""
88
from alembic import op
@@ -11,16 +11,16 @@
1111

1212

1313
# revision identifiers, used by Alembic.
14-
revision = '44fc2bbcc925'
14+
revision = 'fe56fa70289e'
1515
down_revision = '1a31ce608336'
1616
branch_labels = None
1717
depends_on = None
1818

1919

2020
def upgrade():
2121
# ### commands auto generated by Alembic - please adjust! ###
22-
op.add_column('item', sa.Column('created_at', sa.DateTime(timezone=True), nullable=False))
23-
op.add_column('user', sa.Column('created_at', sa.DateTime(timezone=True), nullable=False))
22+
op.add_column('item', sa.Column('created_at', sa.DateTime(timezone=True), nullable=True))
23+
op.add_column('user', sa.Column('created_at', sa.DateTime(timezone=True), nullable=True))
2424
# ### end Alembic commands ###
2525

2626

backend/app/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class UpdatePassword(SQLModel):
4949
class User(UserBase, table=True):
5050
id: uuid.UUID = Field(default_factory=uuid.uuid4, primary_key=True)
5151
hashed_password: str
52-
created_at: datetime = Field(
52+
created_at: datetime | None = Field(
5353
default_factory=get_datetime_utc,
5454
sa_type=DateTime(timezone=True), # type: ignore
5555
)
@@ -85,7 +85,7 @@ class ItemUpdate(ItemBase):
8585
# Database model, database table inferred from class name
8686
class Item(ItemBase, table=True):
8787
id: uuid.UUID = Field(default_factory=uuid.uuid4, primary_key=True)
88-
created_at: datetime = Field(
88+
created_at: datetime | None = Field(
8989
default_factory=get_datetime_utc,
9090
sa_type=DateTime(timezone=True), # type: ignore
9191
)

0 commit comments

Comments
 (0)