-- Create admins table + one default admin user
CREATE TABLE IF NOT EXISTS admins (
  id INT AUTO_INCREMENT PRIMARY KEY,
  email VARCHAR(190) NOT NULL UNIQUE,
  password_hash VARCHAR(255) NOT NULL,
  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

-- Default admin: admin@ipray.local
-- Password: ChangeMe123!
INSERT INTO admins (email, password_hash)
VALUES ('admin@ipray.local', '$2y$10$0K4xCBoU/oc8VGP1VrVXbOS1SFyGLvG7Co7fahjtdurW0GfH3E5tC')
ON DUPLICATE KEY UPDATE email=email;
