-- =============================================================================
-- Local dev database provisioning for Vihar Sewa.
-- Run as MySQL root: mysql -u root -p < scripts/init-db.sql
--
-- For production on kreonAI5, see scripts/init-db.prod.sql (Turn 4).
-- =============================================================================

CREATE DATABASE IF NOT EXISTS vihar_db
  CHARACTER SET utf8mb4
  COLLATE utf8mb4_unicode_ci;

-- Dev user. Change password if exposing beyond localhost.
CREATE USER IF NOT EXISTS 'vihar_usr'@'localhost'
  IDENTIFIED BY 'vihar_pwd';

GRANT ALL PRIVILEGES ON vihar_db.* TO 'vihar_usr'@'localhost';

FLUSH PRIVILEGES;

-- Verify
SELECT
  CONCAT('✓ Database ready. Connect with: ',
         'mysql://vihar_usr:vihar_pwd@localhost:3306/vihar_db') AS status;
