ccfb674318
continuous-integration/drone/push Build is passing
- Implement Social Features: Shared Tasks, Global Access, Privacy Settings (Leaderboard/Searchable). - Add Leaderboard Page and API. - Enhance Auth: Support Email/Username login, explicit duplicate registration errors. - Fix: Admin login password hash regression. - Refactor: Move to wouter for routing, add Admin Dashboard and User Management. - Add Setup Wizard. - Update UI with Sidebar and Gamification elements.
24 lines
809 B
SQL
24 lines
809 B
SQL
-- Create system_settings table
|
|
CREATE TABLE IF NOT EXISTS system_settings (
|
|
id varchar(255) PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
key text NOT NULL UNIQUE,
|
|
value text NOT NULL,
|
|
updated_at timestamp DEFAULT now()
|
|
);
|
|
|
|
-- Truncate users to avoid constraint issues and reset for First Run
|
|
TRUNCATE TABLE users CASCADE;
|
|
TRUNCATE TABLE user_rewards CASCADE;
|
|
TRUNCATE TABLE xp_events CASCADE;
|
|
TRUNCATE TABLE goals CASCADE;
|
|
TRUNCATE TABLE notes CASCADE;
|
|
|
|
-- Add new columns to users
|
|
ALTER TABLE users ADD COLUMN IF NOT EXISTS email text NOT NULL UNIQUE;
|
|
ALTER TABLE users ADD COLUMN IF NOT EXISTS role text NOT NULL DEFAULT 'user';
|
|
ALTER TABLE users ADD COLUMN IF NOT EXISTS is_active boolean NOT NULL DEFAULT true;
|
|
|
|
-- Verification
|
|
SELECT count(*) FROM system_settings;
|
|
SELECT count(*) FROM users;
|