-- Create Database
CREATE DATABASE IF NOT EXISTS sanibook_vol1;
USE sanibook_vol1;

-- Create User (if not exists) and Grant Permissions
CREATE USER IF NOT EXISTS 'sanibook_vol1'@'localhost' IDENTIFIED BY 'wTrbtgL9kvnVMqymrJWf';
GRANT ALL PRIVILEGES ON sanibook_vol1.* TO 'sanibook_vol1'@'localhost';
FLUSH PRIVILEGES;

-- Create Table
CREATE TABLE IF NOT EXISTS `submissions` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `org_name` varchar(255) NOT NULL,
  `contact_person` varchar(255) NOT NULL,
  `contact_role` varchar(100) NOT NULL,
  `email` varchar(255) NOT NULL,
  `mobile` varchar(20) NOT NULL,
  `role` varchar(100) DEFAULT NULL COMMENT 'Org Type',
  `county` varchar(100) DEFAULT NULL,
  `story` text DEFAULT NULL,
  `verification_code` varchar(10) DEFAULT NULL,
  `is_verified` tinyint(1) DEFAULT 0,
  `password_hash` varchar(255) NOT NULL,
  `created_at` timestamp DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
