-- Document Confirmation System Database Setup
-- Run this SQL to set up the required tables for the document confirmation demo

CREATE TABLE IF NOT EXISTS `document_confirmation` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `coc_accepted` enum('Yes','No') DEFAULT 'No',
  `gdpr_accepted` enum('Yes','No') DEFAULT 'No',
  `club_rules_accepted` enum('Yes','No') DEFAULT 'No',
  `coc_accepted_date` datetime DEFAULT NULL,
  `gdpr_accepted_date` datetime DEFAULT NULL,
  `club_rules_accepted_date` datetime DEFAULT NULL,
  `last_login` datetime DEFAULT NULL,
  `created_at` timestamp DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- Insert test users
INSERT IGNORE INTO `document_confirmation` (`name`, `coc_accepted`, `gdpr_accepted`, `club_rules_accepted`, `last_login`) VALUES
('DavidR', 'No', 'No', 'No', NOW()),
('BarryK', 'No', 'No', 'No', NOW()),
('admin', 'No', 'No', 'No', NOW());
