diff --git a/invokeai/app/services/board_image_record_storage.py b/invokeai/app/services/board_image_record_storage.py index ae2f1a98958..7aff41860cd 100644 --- a/invokeai/app/services/board_image_record_storage.py +++ b/invokeai/app/services/board_image_record_storage.py @@ -93,10 +93,10 @@ def _create_tables(self) -> None: created_at DATETIME NOT NULL DEFAULT(STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), -- updated via trigger updated_at DATETIME NOT NULL DEFAULT(STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), - -- enforce one-to-many relationship between boards and images using PK - -- (we can extend this to many-to-many later) -- Soft delete, currently unused deleted_at DATETIME, + -- enforce one-to-many relationship between boards and images using PK + -- (we can extend this to many-to-many later) PRIMARY KEY (image_name), FOREIGN KEY (board_id) REFERENCES boards (board_id) ON DELETE CASCADE, FOREIGN KEY (image_name) REFERENCES images (image_name) ON DELETE CASCADE diff --git a/invokeai/app/services/models/board_record.py b/invokeai/app/services/models/board_record.py index 325ddd094e7..bf5401b2098 100644 --- a/invokeai/app/services/models/board_record.py +++ b/invokeai/app/services/models/board_record.py @@ -19,6 +19,10 @@ class BoardRecord(BaseModel): description="The updated timestamp of the board." ) """The updated timestamp of the image.""" + deleted_at: Union[datetime, str, None] = Field( + description="The deleted timestamp of the board." + ) + """The updated timestamp of the image.""" cover_image_name: Optional[str] = Field( description="The name of the cover image of the board." ) @@ -46,7 +50,7 @@ def deserialize_board_record(board_dict: dict) -> BoardRecord: cover_image_name = board_dict.get("cover_image_name", "unknown") created_at = board_dict.get("created_at", get_iso_timestamp()) updated_at = board_dict.get("updated_at", get_iso_timestamp()) - # deleted_at = board_dict.get("deleted_at", get_iso_timestamp()) + deleted_at = board_dict.get("deleted_at", get_iso_timestamp()) return BoardRecord( board_id=board_id, @@ -54,5 +58,5 @@ def deserialize_board_record(board_dict: dict) -> BoardRecord: cover_image_name=cover_image_name, created_at=created_at, updated_at=updated_at, - # deleted_at=deleted_at, + deleted_at=deleted_at, )