-- https://www.phpmyadmin.net/
--

START TRANSACTION;



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

--
-- Table structure for table `aadminroles`
--

CREATE TABLE `aadminroles` (
  `ARId` int(11) NOT NULL,
  `ARAdmin` int(11) DEFAULT NULL,
  `ARRoles` text DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `aadminroles`
--

INSERT INTO `aadminroles` (`ARId`, `ARAdmin`, `ARRoles`) VALUES
(1, 1, '1,2,3,4,5,6,7,8'),
(4, 6, '1');

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

--
-- Table structure for table `asidemenu`
--

CREATE TABLE `asidemenu` (
  `ASId` int(11) NOT NULL,
  `ASMenu` varchar(50) DEFAULT NULL,
  `ASLink` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `asidemenu`
--

INSERT INTO `asidemenu` (`ASId`, `ASMenu`, `ASLink`) VALUES
(1, 'Dashboard', './'),
(2, 'Users', 'user'),
(3, 'Appointment', 'appointment'),
(4, 'Store', 'store'),
(5, 'Advert', 'advert'),
(6, 'System', 'system'),
(7, 'Feedback', 'feedback'),
(8, 'Admin', 'admin');

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

--
-- Table structure for table `bnotif`
--

CREATE TABLE `bnotif` (
  `ANId` int(11) NOT NULL,
  `ANUser` int(11) DEFAULT NULL,
  `ANMsg` text NOT NULL,
  `ANTitle` varchar(50) DEFAULT NULL,
  `ANStatus` enum('N','S') NOT NULL DEFAULT 'N' COMMENT 'NEW AND SEEN',
  `ANDate` timestamp NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `bnotif`
--

INSERT INTO `bnotif` (`ANId`, `ANUser`, `ANMsg`, `ANTitle`, `ANStatus`, `ANDate`) VALUES
(1, 1, 'Your Emergency has been resolved', 'Kidnapping', 'S', '2025-09-20 20:41:09');

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

--
-- Table structure for table `botp`
--

CREATE TABLE `botp` (
  `OId` int(11) NOT NULL,
  `OUser` int(11) NOT NULL DEFAULT 0,
  `OCode` varchar(10) DEFAULT NULL,
  `OExpiryDate` varchar(50) DEFAULT NULL,
  `OStatus` enum('U','N') NOT NULL DEFAULT 'N' COMMENT 'New, Used'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `botp`
--

INSERT INTO `botp` (`OId`, `OUser`, `OCode`, `OExpiryDate`, `OStatus`) VALUES
(1, 1, 'd3D0S', '1751211816', 'U'),
(2, 9, '4434', '1758400316', 'U'),
(3, 4, '7634', '1758399191', 'U'),
(4, 5, '3265', '1758399194', 'U'),
(5, 6, '9876', '1758399181', 'U'),
(6, 7, '3217', '1758399091', 'U'),
(7, 8, '0913', '1758319191', 'U');

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

--
-- Table structure for table `cagency`
--

CREATE TABLE `cagency` (
  `CAId` int(11) NOT NULL,
  `CAName` varchar(100) DEFAULT NULL,
  `CAStatus` enum('A','D') NOT NULL DEFAULT 'D'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `cagency`
--

INSERT INTO `cagency` (`CAId`, `CAName`, `CAStatus`) VALUES
(1, 'Police', 'A');

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

--
-- Table structure for table `ccars`
--

CREATE TABLE `ccars` (
  `CId` int(11) NOT NULL,
  `CUser` int(11) DEFAULT NULL,
  `CMake` varchar(50) DEFAULT NULL,
  `CModel` varchar(100) DEFAULT NULL,
  `CYear` varchar(50) DEFAULT NULL,
  `CLicensePlate` varchar(50) DEFAULT NULL,
  `CColor` varchar(50) DEFAULT NULL,
  `CRegNo` varchar(50) DEFAULT NULL,
  `CStatus` enum('A','D') NOT NULL DEFAULT 'D',
  `CTimestamp` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `ccars`
--

INSERT INTO `ccars` (`CId`, `CUser`, `CMake`, `CModel`, `CYear`, `CLicensePlate`, `CColor`, `CRegNo`, `CStatus`, `CTimestamp`) VALUES
(5, 1, 'BMW', '3 series 330i xDrive', '2023', 'BMZ-7659', 'Black', 'CA-BMW-6551', 'A', '2025-09-20 19:46:24');

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

--
-- Table structure for table `cemergencies`
--

CREATE TABLE `cemergencies` (
  `EId` int(11) NOT NULL,
  `EAgency` int(11) DEFAULT NULL,
  `EEmergency` varchar(100) DEFAULT NULL,
  `ERewardPoint` float DEFAULT NULL,
  `EStatus` enum('A','D') NOT NULL DEFAULT 'D'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `cemergencies`
--

INSERT INTO `cemergencies` (`EId`, `EAgency`, `EEmergency`, `ERewardPoint`, `EStatus`) VALUES
(1, 1, 'Extreme Emergency', 100, 'A'),
(2, 1, 'Robbery', 100, 'A'),
(3, 1, 'One Chance Drivers', 100, 'A'),
(5, 1, 'Kidnapping', 100, 'A');

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

--
-- Table structure for table `cissue`
--

CREATE TABLE `cissue` (
  `IId` int(11) NOT NULL,
  `IAgency` int(11) DEFAULT NULL,
  `IDivision` int(11) DEFAULT NULL,
  `ILicenseplate` varchar(50) DEFAULT NULL,
  `IType` int(11) DEFAULT NULL,
  `IDesc` text NOT NULL,
  `ILocation` varchar(255) DEFAULT NULL,
  `IStatus` enum('Unpaid','Paid') NOT NULL DEFAULT 'Unpaid',
  `ITimestamp` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `cissue`
--

INSERT INTO `cissue` (`IId`, `IAgency`, `IDivision`, `ILicenseplate`, `IType`, `IDesc`, `ILocation`, `IStatus`, `ITimestamp`) VALUES
(1, 1, 1, 'BMZ-7659', 1, 'you\'ve been fined for wrong parking', '8.9848302601844, 7.493798297373247', 'Unpaid', '2025-09-22 12:56:02');

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

--
-- Table structure for table `cissuemedia`
--

CREATE TABLE `cissuemedia` (
  `IMId` int(11) NOT NULL,
  `IMIssue` int(11) DEFAULT NULL,
  `IMLink` varchar(100) DEFAULT NULL,
  `IMType` enum('image','video') NOT NULL DEFAULT 'image',
  `IMStatus` enum('A','D') NOT NULL DEFAULT 'D',
  `IMTimestamp` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `cissuemedia`
--

INSERT INTO `cissuemedia` (`IMId`, `IMIssue`, `IMLink`, `IMType`, `IMStatus`, `IMTimestamp`) VALUES
(1, 1, 'report_video_68d14762207e1.mp4', 'video', 'A', '2025-09-22 12:56:02'),
(2, 1, 'report_image_68d14762210cc.jpg', 'image', 'A', '2025-09-22 12:56:02');

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

--
-- Table structure for table `cissuetype`
--

CREATE TABLE `cissuetype` (
  `ITId` int(11) NOT NULL,
  `ITAgency` int(11) DEFAULT NULL,
  `ITType` varchar(255) DEFAULT NULL,
  `ITFine` float NOT NULL DEFAULT 0,
  `ITStatus` enum('A','D') NOT NULL DEFAULT 'D',
  `ITTimestamp` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `cissuetype`
--

INSERT INTO `cissuetype` (`ITId`, `ITAgency`, `ITType`, `ITFine`, `ITStatus`, `ITTimestamp`) VALUES
(1, 1, 'Wrong Parking', 1000, 'A', '2025-09-22 12:49:01');

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

--
-- Table structure for table `creportincidence`
--

CREATE TABLE `creportincidence` (
  `RIId` int(11) NOT NULL,
  `RIAgency` int(11) DEFAULT NULL,
  `RIIncidence` varchar(100) DEFAULT NULL,
  `RIReward` float NOT NULL DEFAULT 0,
  `RIStatus` enum('A','I','D') NOT NULL DEFAULT 'D',
  `RITimestamp` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `creportincidence`
--

INSERT INTO `creportincidence` (`RIId`, `RIAgency`, `RIIncidence`, `RIReward`, `RIStatus`, `RITimestamp`) VALUES
(1, 1, 'Cult clash', 100, 'A', '2025-08-11 07:46:43'),
(2, 1, 'Noise Pollution', 100, 'A', '2025-08-11 07:46:43'),
(3, 1, 'Potholes', 100, 'A', '2025-08-30 15:28:50');

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

--
-- Table structure for table `creportmedia`
--

CREATE TABLE `creportmedia` (
  `RMId` int(11) NOT NULL,
  `RMReport` int(11) NOT NULL,
  `RMLink` varchar(255) DEFAULT NULL,
  `RMType` enum('video','image') NOT NULL DEFAULT 'image',
  `RMStatus` enum('A','D') NOT NULL DEFAULT 'D'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `creportmedia`
--

INSERT INTO `creportmedia` (`RMId`, `RMReport`, `RMLink`, `RMType`, `RMStatus`) VALUES
(1, 1, 'report_video_68b41581c383d.mp4', 'video', 'A'),
(2, 1, 'report_image_68b41581c454d.jpg', 'image', 'A'),
(3, 2, 'report_video_68b41585ec6ba.mp4', 'video', 'A'),
(4, 2, 'report_image_68b41585ecd70.jpg', 'image', 'A'),
(5, 3, 'report_video_68b415913c6fb.mp4', 'video', 'A'),
(6, 3, 'report_image_68b415913cf77.jpg', 'image', 'A'),
(7, 4, 'report_video_68b4159459c26.mp4', 'video', 'A'),
(8, 4, 'report_image_68b415945a2c2.jpg', 'image', 'A'),
(9, 5, 'report_image_68b8315678400.jpg', 'image', 'A'),
(10, 5, 'report_video_68b831567b0ae.mov', 'video', 'A'),
(11, 6, 'report_image_68b83199de73f.jpg', 'image', 'A'),
(12, 6, 'report_video_68b83199e080d.mov', 'video', 'A'),
(13, 7, 'report_image_68b8550ab5644.jpg', 'image', 'A');

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

--
-- Table structure for table `creports`
--

CREATE TABLE `creports` (
  `RId` int(11) NOT NULL,
  `RAgency` int(11) DEFAULT NULL,
  `RDivision` int(11) DEFAULT NULL,
  `RRejectedBy` int(11) DEFAULT NULL,
  `RUser` int(11) DEFAULT NULL,
  `RIncidence` int(11) DEFAULT NULL,
  `RDesc` text NOT NULL,
  `RLocation` varchar(255) DEFAULT NULL,
  `RNote` text DEFAULT NULL,
  `RStatus` enum('NEW','INPROGRESS','REJECTED','RESOLVED') NOT NULL DEFAULT 'NEW',
  `RTimestamp` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `creports`
--

INSERT INTO `creports` (`RId`, `RAgency`, `RDivision`, `RRejectedBy`, `RUser`, `RIncidence`, `RDesc`, `RLocation`, `RNote`, `RStatus`, `RTimestamp`) VALUES
(1, 1, NULL, 1, 1, 1, 'please help us', '8.9848302601844, 7.493798297373247', 'Hhh', 'REJECTED', '2025-08-31 09:27:29'),
(2, 1, 1, NULL, 1, 1, 'please help us', '8.9848302601844, 7.493798297373247', 'Hi', 'RESOLVED', '2025-08-31 09:27:33'),
(3, 1, NULL, NULL, 1, 2, 'save me', '8.9848302601844, 7.493798297373247', '', 'NEW', '2025-08-31 09:27:45'),
(4, 1, NULL, NULL, 1, 2, 'save me', '8.9848302601844, 7.493798297373247', '', 'NEW', '2025-08-31 09:27:48'),
(5, 1, 1, NULL, 1, 1, 'Test', '8.984108, 7.487617', 'Resolved sharp', 'RESOLVED', '2025-09-03 12:15:18'),
(6, 1, 1, 1, 1, 1, 'Testing2', '8.984108, 7.487617', 'Hojjj', 'REJECTED', '2025-09-03 12:16:25'),
(7, 1, 1, 1, 1, 2, 'testing andriod', '37.422094, -122.083922', 'Yes', 'REJECTED', '2025-09-03 14:47:38');

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

--
-- Table structure for table `crewardhistory`
--

CREATE TABLE `crewardhistory` (
  `RHId` int(11) NOT NULL,
  `RHUser` int(11) DEFAULT NULL,
  `RHTitle` varchar(50) DEFAULT NULL,
  `RHAmount` float NOT NULL DEFAULT 0,
  `RHTimestamp` timestamp NOT NULL DEFAULT current_timestamp(),
  `RHStatus` varchar(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `crewardhistory`
--

INSERT INTO `crewardhistory` (`RHId`, `RHUser`, `RHTitle`, `RHAmount`, `RHTimestamp`, `RHStatus`) VALUES
(1, 1, 'Cult clash', 100, '2025-08-30 18:10:20', 'successful'),
(2, 1, 'Cult clash', 100, '2025-08-30 18:11:58', 'successful'),
(3, 1, 'Cult clash', 100, '2025-09-03 22:04:58', 'successful'),
(4, 1, 'Cult clash', 100, '2025-09-03 22:11:27', 'successful');

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

--
-- Table structure for table `csos`
--

CREATE TABLE `csos` (
  `SId` int(11) NOT NULL,
  `SEmergency` int(11) DEFAULT NULL,
  `SDivision` int(11) DEFAULT NULL,
  `SUser` int(11) DEFAULT NULL,
  `SLocation` varchar(255) DEFAULT NULL,
  `ETA` varchar(50) DEFAULT NULL,
  `SRejectionReason` varchar(255) DEFAULT NULL,
  `STimestamp` timestamp NOT NULL DEFAULT current_timestamp(),
  `SStatus` enum('WAITING','ACCEPTED','TIMED','RESOLVED','FALSE') NOT NULL DEFAULT 'WAITING'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `csos`
--

INSERT INTO `csos` (`SId`, `SEmergency`, `SDivision`, `SUser`, `SLocation`, `ETA`, `SRejectionReason`, `STimestamp`, `SStatus`) VALUES
(19, 1, NULL, 1, '8.9848302601844, 7.493798297373247', NULL, NULL, '2025-08-31 12:02:47', 'WAITING'),
(20, 1, NULL, 1, '8.985311563062515, 7.487395307452727', NULL, NULL, '2025-09-03 15:19:15', 'WAITING');

--
-- Indexes for table `aadminroles`
--
ALTER TABLE `aadminroles`
  ADD PRIMARY KEY (`ARId`),
  ADD KEY `FK_aadminroles_aadmin` (`ARAdmin`);

--
-- Indexes for table `asidemenu`
--
ALTER TABLE `asidemenu`
  ADD PRIMARY KEY (`ASId`);

--
-- Indexes for table `bnotif`
--
ALTER TABLE `bnotif`
  ADD PRIMARY KEY (`ANId`),
  ADD KEY `ANStatus` (`ANStatus`),
  ADD KEY `FK_anotif_ausers` (`ANUser`),
  ADD KEY `ANStatus_2` (`ANStatus`);

--
-- Indexes for table `botp`
--
ALTER TABLE `botp`
  ADD PRIMARY KEY (`OId`),
  ADD KEY `FK_kotp_kusers` (`OUser`),
  ADD KEY `OStatus` (`OStatus`),
  ADD KEY `OCode` (`OCode`),
  ADD KEY `OExpiryDate` (`OExpiryDate`),
  ADD KEY `OStatus_2` (`OStatus`),
  ADD KEY `OExpiryDate_2` (`OExpiryDate`),
  ADD KEY `OCode_2` (`OCode`);

--
-- Indexes for table `cagency`
--
ALTER TABLE `cagency`
  ADD PRIMARY KEY (`CAId`),
  ADD KEY `CAStatus` (`CAStatus`);

--
-- Indexes for table `ccars`
--
ALTER TABLE `ccars`
  ADD PRIMARY KEY (`CId`),
  ADD UNIQUE KEY `CLicensePlate` (`CLicensePlate`),
  ADD UNIQUE KEY `CRegNo` (`CRegNo`),
  ADD KEY `CStatus` (`CStatus`),
  ADD KEY `CUser` (`CUser`);

--
-- Indexes for table `cemergencies`
--
ALTER TABLE `cemergencies`
  ADD PRIMARY KEY (`EId`),
  ADD KEY `EAgency` (`EAgency`),
  ADD KEY `EStatus` (`EStatus`);

--
-- Indexes for table `cissue`
--
ALTER TABLE `cissue`
  ADD PRIMARY KEY (`IId`),
  ADD KEY `IType` (`IType`),
  ADD KEY `IAgency` (`IAgency`),
  ADD KEY `IStatus` (`IStatus`),
  ADD KEY `ILicenseplate` (`ILicenseplate`),
  ADD KEY `IDivision` (`IDivision`);

--
-- Indexes for table `cissuemedia`
--
ALTER TABLE `cissuemedia`
  ADD PRIMARY KEY (`IMId`),
  ADD KEY `IMIssue` (`IMIssue`);

--
-- Indexes for table `cissuetype`
--
ALTER TABLE `cissuetype`
  ADD PRIMARY KEY (`ITId`),
  ADD KEY `ITStatus` (`ITStatus`),
  ADD KEY `ITAgency` (`ITAgency`);

--
-- Indexes for table `creportincidence`
--
ALTER TABLE `creportincidence`
  ADD PRIMARY KEY (`RIId`),
  ADD KEY `RIAgency` (`RIAgency`),
  ADD KEY `RIStatus` (`RIStatus`);

--
-- Indexes for table `creportmedia`
--
ALTER TABLE `creportmedia`
  ADD PRIMARY KEY (`RMId`),
  ADD KEY `RMReport` (`RMReport`),
  ADD KEY `RMStatus` (`RMStatus`),
  ADD KEY `RMType` (`RMType`);

--
-- Indexes for table `creports`
--
ALTER TABLE `creports`
  ADD PRIMARY KEY (`RId`),
  ADD KEY `RAgency` (`RAgency`),
  ADD KEY `RDivision` (`RDivision`),
  ADD KEY `RIncidence` (`RIncidence`),
  ADD KEY `RUser` (`RUser`),
  ADD KEY `RStatus` (`RStatus`),
  ADD KEY `RRejectedBy` (`RRejectedBy`);

--
-- Indexes for table `crewardhistory`
--
ALTER TABLE `crewardhistory`
  ADD PRIMARY KEY (`RHId`),
  ADD KEY `RHUser` (`RHUser`),
  ADD KEY `RHStatus` (`RHStatus`);

--
-- Indexes for table `csos`
--
ALTER TABLE `csos`
  ADD PRIMARY KEY (`SId`),
  ADD KEY `SDivision` (`SDivision`),
  ADD KEY `SEmergency` (`SEmergency`),
  ADD KEY `SUser` (`SUser`),
  ADD KEY `SStatus` (`SStatus`);

--
-- AUTO_INCREMENT for table `aadminroles`
--
ALTER TABLE `aadminroles`
  MODIFY `ARId` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `asidemenu`
--
ALTER TABLE `asidemenu`
  MODIFY `ASId` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;

--
-- AUTO_INCREMENT for table `bnotif`
--
ALTER TABLE `bnotif`
  MODIFY `ANId` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `botp`
--
ALTER TABLE `botp`
  MODIFY `OId` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;

--
-- AUTO_INCREMENT for table `cagency`
--
ALTER TABLE `cagency`
  MODIFY `CAId` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `ccars`
--
ALTER TABLE `ccars`
  MODIFY `CId` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `cemergencies`
--
ALTER TABLE `cemergencies`
  MODIFY `EId` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `cissue`
--
ALTER TABLE `cissue`
  MODIFY `IId` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `cissuemedia`
--
ALTER TABLE `cissuemedia`
  MODIFY `IMId` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `cissuetype`
--
ALTER TABLE `cissuetype`
  MODIFY `ITId` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `creportincidence`
--
ALTER TABLE `creportincidence`
  MODIFY `RIId` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `creportmedia`
--
ALTER TABLE `creportmedia`
  MODIFY `RMId` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14;

--
-- AUTO_INCREMENT for table `creports`
--
ALTER TABLE `creports`
  MODIFY `RId` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;

--
-- AUTO_INCREMENT for table `crewardhistory`
--
ALTER TABLE `crewardhistory`
  MODIFY `RHId` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `csos`
--
ALTER TABLE `csos`
  MODIFY `SId` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=21;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `aadminroles`
--
ALTER TABLE `aadminroles`
  ADD CONSTRAINT `FK_aadminroles_aadmin` FOREIGN KEY (`ARAdmin`) REFERENCES `aadmin` (`AAId`);

--
-- Constraints for table `bnotif`
--
ALTER TABLE `bnotif`
  ADD CONSTRAINT `FK_anotif_ausers` FOREIGN KEY (`ANUser`) REFERENCES `busers` (`UKId`);

--
-- Constraints for table `botp`
--
ALTER TABLE `botp`
  ADD CONSTRAINT `FK_kotp_kusers` FOREIGN KEY (`OUser`) REFERENCES `busers` (`UKId`);

--
-- Constraints for table `ccars`
--
ALTER TABLE `ccars`
  ADD CONSTRAINT `ccars_ibfk_1` FOREIGN KEY (`CUser`) REFERENCES `busers` (`UKId`);

--
-- Constraints for table `cemergencies`
--
ALTER TABLE `cemergencies`
  ADD CONSTRAINT `cemergencies_ibfk_1` FOREIGN KEY (`EAgency`) REFERENCES `cagency` (`CAId`);

--
-- Constraints for table `cissue`
--
ALTER TABLE `cissue`
  ADD CONSTRAINT `cissue_ibfk_1` FOREIGN KEY (`IType`) REFERENCES `cissuetype` (`ITId`),
  ADD CONSTRAINT `cissue_ibfk_2` FOREIGN KEY (`IAgency`) REFERENCES `cagency` (`CAId`),
  ADD CONSTRAINT `cissue_ibfk_3` FOREIGN KEY (`IDivision`) REFERENCES `cdivisions` (`CDId`);

--
-- Constraints for table `cissuemedia`
--
ALTER TABLE `cissuemedia`
  ADD CONSTRAINT `cissuemedia_ibfk_1` FOREIGN KEY (`IMIssue`) REFERENCES `cissue` (`IId`);

--
-- Constraints for table `cissuetype`
--
ALTER TABLE `cissuetype`
  ADD CONSTRAINT `cissuetype_ibfk_1` FOREIGN KEY (`ITAgency`) REFERENCES `cagency` (`CAId`);

--
-- Constraints for table `creportincidence`
--
ALTER TABLE `creportincidence`
  ADD CONSTRAINT `creportincidence_ibfk_1` FOREIGN KEY (`RIAgency`) REFERENCES `cagency` (`CAId`);

--
-- Constraints for table `creportmedia`
--
ALTER TABLE `creportmedia`
  ADD CONSTRAINT `creportmedia_ibfk_1` FOREIGN KEY (`RMReport`) REFERENCES `creports` (`RId`);

--
-- Constraints for table `creports`
--
ALTER TABLE `creports`
  ADD CONSTRAINT `creports_ibfk_1` FOREIGN KEY (`RAgency`) REFERENCES `cagency` (`CAId`),
  ADD CONSTRAINT `creports_ibfk_2` FOREIGN KEY (`RDivision`) REFERENCES `cdivisions` (`CDId`),
  ADD CONSTRAINT `creports_ibfk_3` FOREIGN KEY (`RIncidence`) REFERENCES `creportincidence` (`RIId`),
  ADD CONSTRAINT `creports_ibfk_4` FOREIGN KEY (`RUser`) REFERENCES `busers` (`UKId`);

--
-- Constraints for table `crewardhistory`
--
ALTER TABLE `crewardhistory`
  ADD CONSTRAINT `crewardhistory_ibfk_1` FOREIGN KEY (`RHUser`) REFERENCES `busers` (`UKId`);

--
-- Constraints for table `csos`
--
ALTER TABLE `csos`
  ADD CONSTRAINT `csos_ibfk_1` FOREIGN KEY (`SDivision`) REFERENCES `cdivisions` (`CDId`),
  ADD CONSTRAINT `csos_ibfk_2` FOREIGN KEY (`SEmergency`) REFERENCES `cemergencies` (`EId`),
  ADD CONSTRAINT `csos_ibfk_3` FOREIGN KEY (`SUser`) REFERENCES `busers` (`UKId`);
COMMIT;

