feat(versions): schema and VersionDao for hash-keyed photo versions

photo_versions links a version's content_hash to its primary original's;
photo_version_references keeps provenance-only reference photos;
photo_version_display holds the global display choice. VersionDao covers
linking (chains flatten to the root), the display choice, per-original
summaries for /photos, the hidden-row set for non-SQL listings, and the
copy of the original's date/GPS/camera onto version rows. Also the SQL
predicate listings use to hide a version while its original is reachable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Cameron CordesandClaude Opus 5.5 committed 2026-10-30 11:16:32 -04:00
1 parent e7aaa961ad
commit 044240037a
5 files changed
+1155

No files matched your search

+2
View File
@@ -54,6 +54,7 @@ pub mod reconcile;
pub mod schema;
pub mod search_dao;
pub mod user_ai_prefs_dao;
pub mod version_dao;
pub use calendar_dao::{CalendarEventDao, SqliteCalendarEventDao};
pub use daily_summary_dao::{DailySummaryDao, InsertDailySummary, SqliteDailySummaryDao};
@@ -71,6 +72,7 @@ pub use precomputed_reel_dao::{PrecomputedReelDao, SqlitePrecomputedReelDao};
pub use preview_dao::{PreviewDao, SqlitePreviewDao};
pub use search_dao::{SearchHistoryDao, SqliteSearchHistoryDao};
pub use user_ai_prefs_dao::{SqliteUserAiPrefsDao, UserAiPrefsDao};
pub use version_dao::{SqliteVersionDao, VersionDao};
pub trait UserDao {
fn create_user(&mut self, user: &str, password: &str) -> Option<User>;