turash/bugulma/backend/scripts/setup-users.sql

22 lines
825 B
SQL

-- Setup users for each role
-- This script creates/updates users with proper bcrypt-hashed passwords
-- Note: You'll need to generate bcrypt hashes for passwords
-- For now, we'll use a simple approach: update existing users and create new ones
-- The passwords will need to be hashed using the backend's password hashing
-- First, let's see what users exist
SELECT id, email, name, role, is_active FROM users;
-- Update existing admin user to ensure it has admin role
UPDATE users
SET role = 'admin', is_active = true
WHERE email = 'admin@tuganyak.dev';
-- Create/update users for each role
-- Note: These passwords need to be hashed with bcrypt before inserting
-- The backend service handles password hashing, so use the API or a Go script
-- For now, let's create a script that uses the backend's password hashing