-- phpMyAdmin SQL Dump
-- version 5.2.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Nov 27, 2025 at 09:53 AM
-- Server version: 10.4.32-MariaDB
-- PHP Version: 8.2.12

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;

--
-- Database: `doi_platform_dev_db_new`
--

-- --------------------------------------------------------

--
-- Table structure for table `tbl_communities`
--

DROP TABLE IF EXISTS `tbl_communities`;
CREATE TABLE `tbl_communities` (
  `c_id` int(11) NOT NULL,
  `name` varchar(100) NOT NULL,
  `district_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `tbl_communities`
--

INSERT INTO `tbl_communities` (`c_id`, `name`, `district_id`) VALUES
(1, 'Albertina', 0),
(2, 'Arniston', 5),
(3, 'Ashton', 2),
(4, 'Community4', 0),
(5, 'Beaufort West', 3),
(6, 'Bergvliet', 0),
(7, 'Bredasdorp', 5),
(8, 'Caledon', 5),
(9, 'Calitzdorp', 0),
(10, 'Cape Town', 0),
(11, 'Ceres', 2),
(12, 'Clanwilliam', 6),
(13, 'Claremont', 0),
(14, 'Constantia', 0),
(15, 'De Rust', 0),
(16, 'George', 4),
(17, 'Grabouw', 5),
(18, 'Hardys Memories of Africa', 0),
(19, 'Hermanus', 5),
(20, 'Knysna', 4),
(21, 'Kraaifontein', 0),
(22, 'Ladismith', 4),
(23, 'Laingsburg', 3),
(24, 'Lansdowne', 0),
(25, 'Malmesbury', 6),
(26, 'Moorreesburg', 6),
(27, 'Mossel Bay', 4),
(28, 'Newlands', 0),
(29, 'Oudtshoorn', 4),
(30, 'Paarl', 2),
(31, 'Piketberg', 6),
(32, 'Plettenberg Bay', 4),
(33, 'Prince Albert', 3),
(34, 'Retreat', 0),
(35, 'Riversdale', 4),
(36, 'Rondebosch', 0),
(37, 'Rosebank', 0),
(38, 'Saldanha', 6),
(39, 'Stellenbosch', 2),
(40, 'Sunset Beach', 0),
(41, 'Swellendam', 5),
(42, 'Vredenburg', 6),
(43, 'Vredendal', 6),
(44, 'Worcester', 0),
(45, 'Other Munsi', 0),
(46, 'Worcester West', 0),
(47, 'Worcester East', 0),
(48, 'Aurora', 6),
(49, 'Bitterfontein', 6),
(50, 'Citrusdal', 6),
(51, 'Darling', 6),
(52, 'Bonnievale', 2),
(53, 'De Doorns', 2),
(54, 'Franschhoek', 2),
(55, 'Gouda', 2),
(56, 'Kayamandi', 2),
(57, 'Atlantis', 1),
(58, 'Bellville', 1),
(59, 'Blouberg', 1),
(60, 'Delft', 1),
(61, 'Khayelitsha', 1),
(62, 'Mitchell’s Plain', 1),
(63, 'Simon’s Town', 1),
(64, 'Strand', 1),
(65, 'Dwarskersbos', 6),
(66, 'Hopefield', 6),
(67, 'Jacobs Bay', 6),
(68, 'Klawer', 6),
(69, 'Koekenaap', 6),
(70, 'Lamberts Bay', 6),
(71, 'Langebaan', 6),
(72, 'Porterville', 6),
(73, 'Redelinghuys', 6),
(74, 'St. Helena Bay', 6),
(75, 'Strandfontein', 6),
(76, 'Wupperthal', 6),
(77, 'Yzerfontein', 6),
(78, 'Klapmuts', 2),
(79, 'Kylemore', 2),
(80, 'McGregor', 2),
(81, 'Pniel', 2),
(82, 'Prince Alfred’s Hamlet', 2),
(83, 'Rawsonville', 2),
(84, 'Robertson', 2),
(85, 'Saron', 2),
(86, 'Touws River', 2),
(87, 'Wellington', 2),
(88, 'Wemmershoek', 2),
(89, 'Wolseley', 2),
(90, 'Baardskeerdersbos', 5),
(91, 'Betty’s Bay', 5),
(92, 'Birkenhead', 5),
(93, 'De Kelders', 5),
(94, 'Elgin', 5),
(95, 'Elim', 5),
(96, 'Fisherhaven', 5),
(97, 'Gansbaai', 5),
(98, 'Genadendal', 5),
(99, 'Greyton', 5),
(100, 'Kleinmond', 5),
(101, 'Napier', 5),
(102, 'Onrus', 5),
(103, 'Pearly Beach', 5),
(104, 'Pringle Bay', 5),
(105, 'Riviersonderend', 5),
(106, 'Rooi Els', 5),
(107, 'Sandbaai', 5),
(108, 'Stanford', 5),
(109, 'Struisbaai', 5),
(110, 'Suurbraak', 5),
(111, 'Witsand', 4),
(112, 'Glentana', 4),
(113, 'Groot-Brakrivier', 4),
(114, 'Haelman\'s Bay', 4),
(115, 'Hartenbos', 4),
(116, 'Heidelberg', 4),
(117, 'Herbertsdale', 4),
(118, 'Herolds Bay', 4),
(119, 'Hoekwil', 4),
(120, 'Karatar', 4),
(121, 'Keurboomsrivier', 4),
(122, 'Nature’s Valley', 4),
(123, 'Rheenendal', 4),
(124, 'Sedgefield', 4),
(125, 'Stilbaai', 4),
(126, 'Uniondale', 4),
(127, 'Wilderness', 4),
(128, 'Matjiesfontein', 3);
(129, 'Stellenbosch', 1);
(130, 'Witsand', 5);

-- --------------------------------------------------------

--
-- Table structure for table `tbl_districts`
--

DROP TABLE IF EXISTS `tbl_districts`;
CREATE TABLE `tbl_districts` (
  `district_id` int(11) NOT NULL,
  `district_name` varchar(500) NOT NULL,
  `district_short_name` varchar(50) NOT NULL,
  `is_active` tinyint(4) NOT NULL DEFAULT 1,
  `type` enum('district','metropolitan') NOT NULL DEFAULT 'district'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `tbl_districts`
--

INSERT INTO `tbl_districts` (`district_id`, `district_name`, `district_short_name`, `is_active`, `type`) VALUES
(1, 'City of Cape Town', 'CCT', 1, 'metropolitan'),
(2, 'Cape Winelands District Municipality', 'DC2', 1, 'district'),
(3, 'Central Karoo District Municipality', 'DC5', 1, 'district'),
(4, 'Garden Route District Municipality', 'DC4', 1, 'district'),
(5, 'Overberg District Municipality', 'DC3', 1, 'district'),
(6, 'West Coast District Municipality', 'DC1', 1, 'district');

-- --------------------------------------------------------

--
-- Table structure for table `tbl_municipality`
--

DROP TABLE IF EXISTS `tbl_municipality`;
CREATE TABLE `tbl_municipality` (
  `m_id` int(11) NOT NULL,
  `region_id` int(11) NOT NULL,
  `district_id` int(11) NOT NULL,
  `code` varchar(50) DEFAULT NULL,
  `name` varchar(250) DEFAULT NULL,
  `address` varchar(500) DEFAULT NULL,
  `postal_address` varchar(500) DEFAULT NULL,
  `is_active` int(11) NOT NULL DEFAULT 1,
  `creation_date` datetime NOT NULL DEFAULT current_timestamp(),
  `created_by` int(11) DEFAULT NULL,
  `updation_date` datetime NOT NULL DEFAULT current_timestamp(),
  `updated_by` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `tbl_municipality`
--

INSERT INTO `tbl_municipality` (`m_id`, `region_id`, `district_id`, `code`, `name`, `address`, `postal_address`, `is_active`, `creation_date`, `created_by`, `updation_date`, `updated_by`) VALUES
(1, 1, 1, 'Metro', 'City of Cape Town', 'Fifth Floor, Podium Block,Civic Centre,12 Hertzog Blvd,Cape Town,8001', 'Private Bag X9181, Cape Town, 8000', 1, '2025-08-03 09:11:17', 1, '2025-08-03 09:11:17', NULL),
(13, 1, 2, 'BV', 'Breede Valley', NULL, NULL, 1, '2025-08-03 09:11:17', 1, '2025-08-03 09:11:17', NULL),
(14, 1, 2, 'DRA', 'Drakenstein', NULL, NULL, 1, '2025-11-26 12:28:47', 1, '2025-11-26 12:28:47', NULL),
(15, 1, 2, 'LAN', 'Langeberg', NULL, NULL, 1, '2025-11-26 12:28:47', 1, '2025-11-26 12:28:47', NULL),
(16, 1, 2, 'STE', 'Stellenbosch', NULL, NULL, 1, '2025-11-26 12:28:47', 1, '2025-11-26 12:28:47', NULL),
(17, 1, 2, 'WIT', 'Witzenberg', NULL, NULL, 1, '2025-11-26 12:28:47', 1, '2025-11-26 12:28:47', NULL),
(18, 1, 3, 'BEA', 'Beaufort West', NULL, NULL, 1, '2025-11-26 12:32:32', 1, '2025-11-26 12:32:32', NULL),
(19, 1, 3, 'LAI', 'Laingsburg', NULL, NULL, 1, '2025-11-26 12:32:32', 1, '2025-11-26 12:32:32', NULL),
(20, 1, 3, 'PRI', 'Prince Albert', NULL, NULL, 1, '2025-11-26 12:32:32', 1, '2025-11-26 12:32:32', NULL),
(21, 1, 4, 'BIT', 'Bitou', NULL, NULL, 1, '2025-11-26 12:32:32', 1, '2025-11-26 12:32:32', NULL),
(22, 1, 4, 'GEO', 'George', NULL, NULL, 1, '2025-11-26 12:32:32', 1, '2025-11-26 12:32:32', NULL),
(23, 1, 4, 'HES', 'Hessequa', NULL, NULL, 1, '2025-11-26 12:32:32', 1, '2025-11-26 12:32:32', NULL),
(24, 1, 4, 'KAN', 'Kannaland', NULL, NULL, 1, '2025-11-26 12:32:32', 1, '2025-11-26 12:32:32', NULL),
(25, 1, 4, 'KNY', 'Knysna', NULL, NULL, 1, '2025-11-26 12:32:32', 1, '2025-11-26 12:32:32', NULL),
(26, 1, 4, 'MOS', 'Mossel Bay', NULL, NULL, 1, '2025-11-26 12:32:32', 1, '2025-11-26 12:32:32', NULL),
(27, 1, 4, 'OUD', 'Oudtshoorn', NULL, NULL, 1, '2025-11-26 12:32:32', 1, '2025-11-26 12:32:32', NULL),
(28, 1, 5, 'CAG', 'Cape Agulhas', NULL, NULL, 1, '2025-11-26 12:32:32', 1, '2025-11-26 12:32:32', NULL),
(29, 1, 5, 'OVE', 'Overstrand', NULL, NULL, 1, '2025-11-26 12:32:32', 1, '2025-11-26 12:32:32', NULL),
(30, 1, 5, 'SWE', 'Swellendam', NULL, NULL, 1, '2025-11-26 12:32:32', 1, '2025-11-26 12:32:32', NULL),
(31, 1, 5, 'THE', 'Theewaterskloof', NULL, NULL, 1, '2025-11-26 12:32:32', 1, '2025-11-26 12:32:32', NULL),
(32, 1, 6, 'BER', 'Bergrivier', NULL, NULL, 1, '2025-11-26 12:32:32', 1, '2025-11-26 12:32:32', NULL),
(33, 1, 6, 'CED', 'Cederberg', NULL, NULL, 1, '2025-11-26 12:32:32', 1, '2025-11-26 12:32:32', NULL),
(34, 1, 6, 'MAT', 'Matzikama', NULL, NULL, 1, '2025-11-26 12:32:32', 1, '2025-11-26 12:32:32', NULL),
(35, 1, 6, 'SAL', 'Saldanha Bay', NULL, NULL, 1, '2025-11-26 12:32:32', 1, '2025-11-26 12:32:32', NULL),
(36, 1, 6, 'SWA', 'Swartland', NULL, NULL, 1, '2025-11-26 12:32:32', 1, '2025-11-26 12:32:32', NULL);

-- --------------------------------------------------------

--
-- Table structure for table `tbl_project_stg3_gc_communities`
--

DROP TABLE IF EXISTS `tbl_project_stg3_gc_communities`;
CREATE TABLE `tbl_project_stg3_gc_communities` (
  `project_id` int(11) NOT NULL,
  `district_id` int(11) NOT NULL,
  `community_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `tbl_project_stg3_gc_communities`
--

INSERT INTO `tbl_project_stg3_gc_communities` (`project_id`, `district_id`, `community_id`) VALUES
(101, 1, 58),
(101, 1, 61),
(101, 5, 19),
(101, 5, 91),
(101, 5, 93);

-- --------------------------------------------------------

--
-- Table structure for table `tbl_project_stg3_gc_municipalities`
--

DROP TABLE IF EXISTS `tbl_project_stg3_gc_municipalities`;
CREATE TABLE `tbl_project_stg3_gc_municipalities` (
  `project_id` int(11) NOT NULL,
  `district_id` int(11) NOT NULL,
  `municipality_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `tbl_project_stg3_gc_municipalities`
--

INSERT INTO `tbl_project_stg3_gc_municipalities` (`project_id`, `district_id`, `municipality_id`) VALUES
(101, 3, 19),
(101, 3, 20),
(101, 4, 25),
(101, 4, 27);

-- --------------------------------------------------------

--
-- Table structure for table `tbl_project_stg3_gc_regions`
--

DROP TABLE IF EXISTS `tbl_project_stg3_gc_regions`;
CREATE TABLE `tbl_project_stg3_gc_regions` (
  `project_id` int(11) NOT NULL,
  `region_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `tbl_project_stg3_gc_regions`
--

INSERT INTO `tbl_project_stg3_gc_regions` (`project_id`, `region_id`) VALUES
(101, 3),
(101, 7),
(101, 8),
(101, 11),
(101, 12);

--
-- Indexes for dumped tables
--

--
-- Indexes for table `tbl_communities`
--
ALTER TABLE `tbl_communities`
  ADD PRIMARY KEY (`c_id`);

--
-- Indexes for table `tbl_districts`
--
ALTER TABLE `tbl_districts`
  ADD PRIMARY KEY (`district_id`);

--
-- Indexes for table `tbl_municipality`
--
ALTER TABLE `tbl_municipality`
  ADD PRIMARY KEY (`m_id`);

--
-- Indexes for table `tbl_project_stg3_gc_communities`
--
ALTER TABLE `tbl_project_stg3_gc_communities`
  ADD UNIQUE KEY `project_id` (`project_id`,`district_id`,`community_id`);

--
-- Indexes for table `tbl_project_stg3_gc_municipalities`
--
ALTER TABLE `tbl_project_stg3_gc_municipalities`
  ADD UNIQUE KEY `project_id` (`project_id`,`district_id`,`municipality_id`);

--
-- Indexes for table `tbl_project_stg3_gc_regions`
--
ALTER TABLE `tbl_project_stg3_gc_regions`
  ADD UNIQUE KEY `project_id` (`project_id`,`region_id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `tbl_communities`
--
ALTER TABLE `tbl_communities`
  MODIFY `c_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=175;

--
-- AUTO_INCREMENT for table `tbl_districts`
--
ALTER TABLE `tbl_districts`
  MODIFY `district_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;

--
-- AUTO_INCREMENT for table `tbl_municipality`
--
ALTER TABLE `tbl_municipality`
  MODIFY `m_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=37;
COMMIT;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
