feat: Implement comprehensive course analytics, RBAC with roles and authentication, and dynamic passing thresholds.
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
-- Add role column to users table for RBAC sync
|
||||
ALTER TABLE users ADD COLUMN IF NOT EXISTS role TEXT NOT NULL DEFAULT 'student';
|
||||
|
||||
-- Add check constraint
|
||||
ALTER TABLE users ADD CONSTRAINT check_valid_role CHECK (role IN ('admin', 'instructor', 'student'));
|
||||
@@ -0,0 +1,5 @@
|
||||
-- Add passing_percentage to courses (synced from CMS)
|
||||
ALTER TABLE courses ADD COLUMN IF NOT EXISTS passing_percentage INTEGER NOT NULL DEFAULT 70;
|
||||
|
||||
-- Ensure valid range
|
||||
ALTER TABLE courses ADD CONSTRAINT check_passing_percentage CHECK (passing_percentage >= 0 AND passing_percentage <= 100);
|
||||
Reference in New Issue
Block a user