38301-vm/db/migrations/05_admin_setup.sql
Flatlogic Bot 6b9829359b RIT
2026-02-09 09:05:22 +00:00

10 lines
502 B
SQL

-- Migration: Admin Setup
-- Adds a default admin account if not exists
INSERT IGNORE INTO users (username, email, password_hash, is_admin, balance_usdt)
VALUES ('admin', 'admin@example.com', '$2y$10$ogw037RdI4xc57das64Rg.we/M9V.Z3xe7H2VT8eVJJ9t7W6xmZaK', 1, 999999.00);
-- Update all existing users to have a UID if they don't have one (simple sequential)
-- This is a bit tricky in pure SQL without a loop, but we can try setting them to ID
UPDATE users SET uid = id WHERE uid = 0 OR uid IS NULL;