Add rating field to entries (1-10 scale) with UI display and module averages
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user