removed not needed "assets.updated_at" column

This commit is contained in:
bigcat88 2025-08-27 21:58:17 +03:00
parent 871e41aec6
commit bdf4ba24ce
No known key found for this signature in database
GPG Key ID: 1F0BF0EC3CF22721
3 changed files with 1 additions and 7 deletions

View File

@ -23,7 +23,6 @@ def upgrade() -> None:
sa.Column("size_bytes", sa.BigInteger(), nullable=False, server_default="0"), sa.Column("size_bytes", sa.BigInteger(), nullable=False, server_default="0"),
sa.Column("mime_type", sa.String(length=255), nullable=True), sa.Column("mime_type", sa.String(length=255), nullable=True),
sa.Column("created_at", sa.DateTime(timezone=False), nullable=False), sa.Column("created_at", sa.DateTime(timezone=False), nullable=False),
sa.Column("updated_at", sa.DateTime(timezone=False), nullable=False),
sa.CheckConstraint("size_bytes >= 0", name="ck_assets_size_nonneg"), sa.CheckConstraint("size_bytes >= 0", name="ck_assets_size_nonneg"),
) )
op.create_index("ix_assets_mime_type", "assets", ["mime_type"]) op.create_index("ix_assets_mime_type", "assets", ["mime_type"])

View File

@ -47,9 +47,6 @@ class Asset(Base):
created_at: Mapped[datetime] = mapped_column( created_at: Mapped[datetime] = mapped_column(
DateTime(timezone=False), nullable=False, default=utcnow DateTime(timezone=False), nullable=False, default=utcnow
) )
updated_at: Mapped[datetime] = mapped_column(
DateTime(timezone=False), nullable=False, default=utcnow
)
infos: Mapped[list["AssetInfo"]] = relationship( infos: Mapped[list["AssetInfo"]] = relationship(
"AssetInfo", "AssetInfo",

View File

@ -85,7 +85,7 @@ async def ingest_fs_asset(
Upsert Asset identity row + cache state pointing at local file. Upsert Asset identity row + cache state pointing at local file.
Always: Always:
- Insert Asset if missing; else update size_bytes (and updated_at) if different. - Insert Asset if missing;
- Insert AssetCacheState if missing; else update mtime_ns if different. - Insert AssetCacheState if missing; else update mtime_ns if different.
Optionally (when info_name is provided): Optionally (when info_name is provided):
@ -123,7 +123,6 @@ async def ingest_fs_asset(
size_bytes=int(size_bytes), size_bytes=int(size_bytes),
mime_type=mime_type, mime_type=mime_type,
created_at=datetime_now, created_at=datetime_now,
updated_at=datetime_now,
) )
) )
await session.flush() await session.flush()
@ -140,7 +139,6 @@ async def ingest_fs_asset(
existing.mime_type = mime_type existing.mime_type = mime_type
changed = True changed = True
if changed: if changed:
existing.updated_at = datetime_now
out["asset_updated"] = True out["asset_updated"] = True
else: else:
logging.error("Asset %s not found after PK conflict; skipping update.", asset_hash) logging.error("Asset %s not found after PK conflict; skipping update.", asset_hash)