mirror of
https://github.com/tcsenpai/pensieve.git
synced 2025-06-10 04:57:12 +00:00
feat: show update last_scan_at for any update
This commit is contained in:
parent
7e7fa02e23
commit
18d30e6567
@ -60,7 +60,7 @@ class EntityModel(Base):
|
|||||||
file_last_modified_at: Mapped[datetime] = mapped_column(DateTime, nullable=False)
|
file_last_modified_at: Mapped[datetime] = mapped_column(DateTime, nullable=False)
|
||||||
file_type: Mapped[str] = mapped_column(String, nullable=False)
|
file_type: Mapped[str] = mapped_column(String, nullable=False)
|
||||||
file_type_group: Mapped[str] = mapped_column(String, nullable=False)
|
file_type_group: Mapped[str] = mapped_column(String, nullable=False)
|
||||||
last_scan_at: Mapped[datetime | None] = mapped_column(DateTime, nullable=True)
|
last_scan_at: Mapped[datetime | None] = mapped_column(DateTime, onupdate=func.now(), nullable=True)
|
||||||
library_id: Mapped[int] = mapped_column(
|
library_id: Mapped[int] = mapped_column(
|
||||||
Integer, ForeignKey("libraries.id"), nullable=False
|
Integer, ForeignKey("libraries.id"), nullable=False
|
||||||
)
|
)
|
||||||
@ -75,7 +75,7 @@ class EntityModel(Base):
|
|||||||
)
|
)
|
||||||
tags: Mapped[List["TagModel"]] = relationship("TagModel", secondary="entity_tags", lazy="joined")
|
tags: Mapped[List["TagModel"]] = relationship("TagModel", secondary="entity_tags", lazy="joined")
|
||||||
|
|
||||||
# 添加索引
|
# 添加索引
|
||||||
__table_args__ = (
|
__table_args__ = (
|
||||||
Index('idx_filepath', 'filepath'),
|
Index('idx_filepath', 'filepath'),
|
||||||
Index('idx_filename', 'filename'),
|
Index('idx_filename', 'filename'),
|
||||||
@ -136,4 +136,4 @@ class LibraryPluginModel(Base):
|
|||||||
|
|
||||||
# Create the database engine with the path from config
|
# Create the database engine with the path from config
|
||||||
engine = create_engine(f"sqlite:///{get_database_path()}")
|
engine = create_engine(f"sqlite:///{get_database_path()}")
|
||||||
Base.metadata.create_all(engine)
|
Base.metadata.create_all(engine)
|
Loading…
x
Reference in New Issue
Block a user