groups: AI enhance for gallery photos (photo_jobs.group_photo_id, before/after compare modal)

This commit is contained in:
dev
2026-10-09 13:52:02 +03:00
parent df9c67b047
commit ec47659ec6
12 changed files with 1499 additions and 74 deletions
+4 -1
View File
@@ -169,6 +169,7 @@ CREATE TABLE IF NOT EXISTS group_photos (
id SERIAL PRIMARY KEY,
group_id INT NOT NULL REFERENCES groups(id) ON DELETE CASCADE,
photo_path VARCHAR(255) NOT NULL,
photo_original_path VARCHAR(255),
caption TEXT,
taken_at DATE,
sort_order INT DEFAULT 0,
@@ -303,7 +304,8 @@ CREATE INDEX IF NOT EXISTS idx_lesson_report_versions_report ON lesson_report_ve
CREATE TABLE IF NOT EXISTS photo_jobs (
id SERIAL PRIMARY KEY,
entry_id INT NOT NULL REFERENCES entries(id) ON DELETE CASCADE,
entry_id INT REFERENCES entries(id) ON DELETE CASCADE,
group_photo_id INT REFERENCES group_photos(id) ON DELETE CASCADE,
action VARCHAR(20) NOT NULL DEFAULT 'ai',
params JSONB,
before_path VARCHAR(255),
@@ -318,6 +320,7 @@ CREATE TABLE IF NOT EXISTS photo_jobs (
CREATE INDEX IF NOT EXISTS idx_photo_jobs_pending ON photo_jobs(id) WHERE status = 'pending';
CREATE INDEX IF NOT EXISTS idx_photo_jobs_entry_id ON photo_jobs(entry_id);
CREATE INDEX IF NOT EXISTS idx_photo_jobs_group_photo_id ON photo_jobs(group_photo_id);
INSERT INTO settings (key, value) VALUES ('photo_worker_enabled', 'true')
ON CONFLICT (key) DO NOTHING;