From 84ca5a3d8c57c467e27f4a941951fd98df08067e Mon Sep 17 00:00:00 2001 From: dev Date: Sat, 5 Dec 2026 17:33:37 +0300 Subject: [PATCH] Add rating field to entries (1-10 scale) with UI display and module averages --- db/migration.sql | 5 ----- public/index.html | 2 +- public/journal.html | 21 +++++++++++++++++++++ public/js/journal.js | 9 +++++++++ 4 files changed, 31 insertions(+), 6 deletions(-) diff --git a/db/migration.sql b/db/migration.sql index 423391b..106bf40 100644 --- a/db/migration.sql +++ b/db/migration.sql @@ -407,11 +407,6 @@ DO $$ BEGIN ALTER TABLE entries ADD CONSTRAINT entries_rating_check CHECK (rating BETWEEN 1 AND 10); EXCEPTION WHEN duplicate_object THEN NULL; END $$; CREATE INDEX IF NOT EXISTS idx_entries_module_id ON entries(module_id); -UPDATE entries - SET rating = (7 + mod(abs(hashtext(to_char(created_at AT TIME ZONE 'UTC', 'YYYYMMDDHH24MISSMS'))::bigint), 4))::smallint - WHERE module_id IS NOT NULL - AND created_at IS NOT NULL - AND rating IS NULL; CREATE TABLE IF NOT EXISTS student_photos ( id SERIAL PRIMARY KEY, diff --git a/public/index.html b/public/index.html index bbd070a..1a8e722 100644 --- a/public/index.html +++ b/public/index.html @@ -189,7 +189,7 @@ nav a:hover{color:var(--text)}