--
-- Table structure for table `sermons_serm`
--
CREATE TABLE IF NOT EXISTS `sermons_serm` (
  `serm_id` INT AUTO_INCREMENT PRIMARY KEY,
  `serm_title` VARCHAR(255) NOT NULL,
  `serm_speaker` VARCHAR(255) DEFAULT '',
  `serm_date` DATE DEFAULT NULL,
  `serm_description` TEXT,
  `serm_audio_url` VARCHAR(500) DEFAULT '',
  `serm_video_url` VARCHAR(500) DEFAULT '',
  `serm_scripture` VARCHAR(255) DEFAULT '',
  `serm_image_url` VARCHAR(500) DEFAULT '',
  `serm_featured` TINYINT(1) DEFAULT 0,
  `serm_created_at` DATETIME DEFAULT CURRENT_TIMESTAMP,
  `serm_updated_at` DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `serm_created_by` INT DEFAULT NULL
) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_unicode_ci;

--
-- Table structure for table `videos_vid`
--
CREATE TABLE IF NOT EXISTS `videos_vid` (
  `vid_id` INT AUTO_INCREMENT PRIMARY KEY,
  `vid_title` VARCHAR(255) NOT NULL,
  `vid_description` TEXT,
  `vid_url` VARCHAR(500) DEFAULT '',
  `vid_embed_code` TEXT,
  `vid_category` VARCHAR(100) DEFAULT '',
  `vid_thumbnail_url` VARCHAR(500) DEFAULT '',
  `vid_featured` TINYINT(1) DEFAULT 0,
  `vid_date` DATE DEFAULT NULL,
  `vid_created_at` DATETIME DEFAULT CURRENT_TIMESTAMP,
  `vid_updated_at` DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `vid_created_by` INT DEFAULT NULL
) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_unicode_ci;

--
-- Table structure for table `prayer_requests_pray`
--
CREATE TABLE IF NOT EXISTS `prayer_requests_pray` (
  `pray_id` INT AUTO_INCREMENT PRIMARY KEY,
  `pray_name` VARCHAR(255) DEFAULT '',
  `pray_email` VARCHAR(255) DEFAULT '',
  `pray_request` TEXT NOT NULL,
  `pray_status` VARCHAR(20) DEFAULT 'pending',
  `pray_answer_notes` TEXT,
  `pray_created_at` DATETIME DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_unicode_ci;

--
-- Table structure for table `contact_submissions_con`
--
CREATE TABLE IF NOT EXISTS `contact_submissions_con` (
  `con_id` INT AUTO_INCREMENT PRIMARY KEY,
  `con_name` VARCHAR(255) DEFAULT '',
  `con_email` VARCHAR(255) DEFAULT '',
  `con_subject` VARCHAR(255) DEFAULT '',
  `con_message` TEXT NOT NULL,
  `con_read` TINYINT(1) DEFAULT 0,
  `con_created_at` DATETIME DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_unicode_ci;

--
-- Table structure for table `church_content_cct`
-- Stores dynamic page content sections (mandate, vision, history, etc.)
--
CREATE TABLE IF NOT EXISTS `church_content_cct` (
  `cct_id` INT AUTO_INCREMENT PRIMARY KEY,
  `cct_key` VARCHAR(100) NOT NULL UNIQUE,
  `cct_title` VARCHAR(255) DEFAULT '',
  `cct_content` TEXT,
  `cct_image_url` VARCHAR(500) DEFAULT '',
  `cct_icon` VARCHAR(100) DEFAULT '',
  `cct_sort_order` INT DEFAULT 0,
  `cct_updated_at` DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `cct_updated_by` INT DEFAULT NULL
) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_unicode_ci;

--
-- Table structure for table `website_events_evt`
--
CREATE TABLE IF NOT EXISTS `website_events_evt` (
  `evt_id` INT AUTO_INCREMENT PRIMARY KEY,
  `evt_title` VARCHAR(255) NOT NULL,
  `evt_description` TEXT,
  `evt_date` DATE DEFAULT NULL,
  `evt_time` VARCHAR(50) DEFAULT '',
  `evt_category` VARCHAR(100) DEFAULT '',
  `evt_image_url` VARCHAR(500) DEFAULT '',
  `evt_link` VARCHAR(500) DEFAULT '',
  `evt_color` VARCHAR(20) DEFAULT '#0d6efd',
  `evt_featured` TINYINT(1) DEFAULT 0,
  `evt_created_at` DATETIME DEFAULT CURRENT_TIMESTAMP,
  `evt_updated_at` DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `evt_created_by` INT DEFAULT NULL
) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_unicode_ci;

--
-- Table structure for table `website_gallery_gal`
--
CREATE TABLE IF NOT EXISTS `website_gallery_gal` (
  `gal_id` INT AUTO_INCREMENT PRIMARY KEY,
  `gal_title` VARCHAR(255) DEFAULT '',
  `gal_image_url` VARCHAR(500) NOT NULL,
  `gal_description` TEXT,
  `gal_category` VARCHAR(100) DEFAULT '',
  `gal_sort_order` INT DEFAULT 0,
  `gal_created_at` DATETIME DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_unicode_ci;

--
-- Table structure for table `website_team_tem`
--
CREATE TABLE IF NOT EXISTS `website_team_tem` (
  `tem_id` INT AUTO_INCREMENT PRIMARY KEY,
  `tem_name` VARCHAR(255) NOT NULL,
  `tem_role` VARCHAR(255) DEFAULT '',
  `tem_bio` TEXT,
  `tem_image_url` VARCHAR(500) DEFAULT '',
  `tem_color` VARCHAR(20) DEFAULT '#0d6efd',
  `tem_sort_order` INT DEFAULT 0,
  `tem_created_at` DATETIME DEFAULT CURRENT_TIMESTAMP,
  `tem_updated_at` DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_unicode_ci;

--
-- Table structure for table `website_groups_grp`
--
CREATE TABLE IF NOT EXISTS `website_groups_grp` (
  `grp_id` INT AUTO_INCREMENT PRIMARY KEY,
  `grp_name` VARCHAR(255) NOT NULL,
  `grp_day` VARCHAR(50) DEFAULT '',
  `grp_time` VARCHAR(50) DEFAULT '',
  `grp_location` VARCHAR(255) DEFAULT '',
  `grp_description` TEXT,
  `grp_leader` VARCHAR(255) DEFAULT '',
  `grp_email` VARCHAR(255) DEFAULT '',
  `grp_image_url` VARCHAR(500) DEFAULT '',
  `grp_color` VARCHAR(20) DEFAULT '#0d6efd',
  `grp_sort_order` INT DEFAULT 0,
  `grp_created_at` DATETIME DEFAULT CURRENT_TIMESTAMP,
  `grp_updated_at` DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_unicode_ci;

--
-- Table structure for table `group_join_requests_gjr`
--
CREATE TABLE IF NOT EXISTS `group_join_requests_gjr` (
  `gjr_id` INT AUTO_INCREMENT PRIMARY KEY,
  `gjr_group_id` INT NOT NULL,
  `gjr_name` VARCHAR(255) NOT NULL,
  `gjr_email` VARCHAR(255) NOT NULL,
  `gjr_status` VARCHAR(20) DEFAULT 'pending',
  `gjr_created_at` DATETIME DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_unicode_ci;

--
-- Table structure for table `website_ministries_min`
--
CREATE TABLE IF NOT EXISTS `website_ministries_min` (
  `min_id` INT AUTO_INCREMENT PRIMARY KEY,
  `min_title` VARCHAR(255) NOT NULL,
  `min_description` TEXT,
  `min_icon` VARCHAR(100) DEFAULT '',
  `min_bg_color` VARCHAR(20) DEFAULT '#e3f2fd',
  `min_image_url` VARCHAR(500) DEFAULT '',
  `min_sort_order` INT DEFAULT 0,
  `min_created_at` DATETIME DEFAULT CURRENT_TIMESTAMP,
  `min_updated_at` DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_unicode_ci;

--
-- Default church content entries
--
INSERT IGNORE INTO `church_content_cct` (`cct_key`, `cct_title`, `cct_content`) VALUES
('mandate', 'Our Mandate', 'We are called to love God, love people, and make disciples of Jesus Christ. Our mandate comes from the Great Commission – to go into all the world and preach the gospel to every creature.'),
('vision', 'Our Vision', 'To be a vibrant, Spirit-filled community of believers that transforms lives through the power of God''s love, reaching our community and the world with the hope of Jesus Christ.'),
('history', 'Our History', 'Founded by a group of faithful believers with a vision to create a place of worship, fellowship, and community impact. What started as a small gathering has grown into a thriving church family.'),
('mission_statement', 'Our Mission', 'We exist to glorify God by making disciples who love God, love people, and serve the world.'),
('about_intro', 'About Our Church', 'We are a community of believers dedicated to loving God, loving people, and making disciples of Jesus Christ. Our doors are open to everyone, regardless of where you are on your spiritual journey.');
