-- phpMyAdmin SQL Dump
-- version 4.9.5deb2~bpo10+1
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Mar 21, 2022 at 12:40 PM
-- Server version: 10.3.31-MariaDB-0+deb10u1-log
-- PHP Version: 7.3.31-1~deb10u1

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
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: `her_ovc_bbhv`
--

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

--
-- Table structure for table `buitenbeschouwing`
--

CREATE TABLE `buitenbeschouwing` (
  `buitenbeschouwing_id` int(11) NOT NULL,
  `period_id` int(11) NOT NULL,
  `pta_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `config`
--

CREATE TABLE `config` (
  `config_id` int(11) NOT NULL,
  `config_target` varchar(16) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
  `config_key` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `config_value` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `constateringen`
--

CREATE TABLE `constateringen` (
  `constatering_id` int(11) NOT NULL,
  `ppl_id` int(11) NOT NULL,
  `rex_id` int(11) NOT NULL,
  `timestamp` timestamp NOT NULL DEFAULT current_timestamp(),
  `constatering` enum('AANWEZIG','LAAT','AFWEZIG') COLLATE utf8mb4_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `exceptions`
--

CREATE TABLE `exceptions` (
  `exception_id` int(11) NOT NULL,
  `ppl_id` int(11) DEFAULT NULL,
  `period_id` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `files`
--

CREATE TABLE `files` (
  `file_id` int(11) NOT NULL,
  `file_md5` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
  `file_name` varchar(128) COLLATE utf8_unicode_ci NOT NULL,
  `file_ok` int(11) NOT NULL,
  `file_time` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Table structure for table `groepeer`
--

CREATE TABLE `groepeer` (
  `groepeer_id` int(11) NOT NULL,
  `group_id` int(11) NOT NULL,
  `pta_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `group_ids`
--

CREATE TABLE `group_ids` (
  `group_id` int(11) NOT NULL,
  `period_id` int(11) NOT NULL,
  `year_id` int(11) NOT NULL,
  `group_name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `log`
--

CREATE TABLE `log` (
  `log_id` int(11) NOT NULL,
  `log_timestamp` timestamp NOT NULL DEFAULT current_timestamp(),
  `log_ip` varchar(46) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `log_session` varchar(32) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `log_euid` varchar(32) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `log_uid` varchar(32) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `log_admin` int(11) DEFAULT NULL,
  `log_admin_sql` int(11) DEFAULT NULL,
  `log_script` varchar(16) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `log_action` varchar(256) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `log_period_id` int(11) DEFAULT NULL,
  `log_time_float` double NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `momentlocations`
--

CREATE TABLE `momentlocations` (
  `momentlocation_id` int(11) NOT NULL,
  `moment_id` int(11) NOT NULL,
  `momentlocation_lokaal` varchar(64) NOT NULL,
  `momentlocation_surveillant` varchar(64) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `moments`
--

CREATE TABLE `moments` (
  `moment_id` int(11) NOT NULL,
  `period_id` int(11) NOT NULL,
  `moment_date` date NOT NULL,
  `moment_time_start` time NOT NULL,
  `moment_time_end` time NOT NULL,
  `moment_dys_perc` int(11) NOT NULL DEFAULT 20
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `newdetailrooster`
--

CREATE TABLE `newdetailrooster` (
  `newdetailrooster_id` int(11) NOT NULL,
  `momentlocation_id` int(11) NOT NULL,
  `grp_id` int(11) NOT NULL,
  `rooster_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `paper`
--

CREATE TABLE `paper` (
  `paper_id` int(11) NOT NULL,
  `paper_name` varchar(64) DEFAULT NULL,
  `paper_format` varchar(16) DEFAULT NULL,
  `paper_num_x` int(11) DEFAULT NULL,
  `paper_num_y` int(11) DEFAULT NULL,
  `paper_origin_x` int(11) DEFAULT NULL,
  `paper_origin_y` int(11) DEFAULT NULL,
  `paper_step_x` int(11) DEFAULT NULL,
  `paper_step_y` int(11) DEFAULT NULL,
  `paper_window_x` int(11) DEFAULT NULL,
  `paper_window_y` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `period2grp`
--

CREATE TABLE `period2grp` (
  `period_id` int(11) NOT NULL,
  `grp_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `period2maxflags`
--

CREATE TABLE `period2maxflags` (
  `period2maxflags_id` int(11) NOT NULL,
  `period_id` int(11) NOT NULL,
  `leerjr` int(11) NOT NULL,
  `target` varchar(2) COLLATE utf8mb4_unicode_ci NOT NULL,
  `flags` int(11) NOT NULL,
  `max` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `period2selectable`
--

CREATE TABLE `period2selectable` (
  `period2selectable_id` int(11) NOT NULL,
  `period_id` int(11) NOT NULL,
  `pta_id` int(11) NOT NULL,
  `ll` tinyint(1) NOT NULL,
  `doc` tinyint(1) NOT NULL,
  `ment` tinyint(1) NOT NULL,
  `flags` int(11) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `periods`
--

CREATE TABLE `periods` (
  `period_id` int(11) NOT NULL,
  `period_desc` varchar(128) DEFAULT NULL,
  `period_deadline` int(11) DEFAULT NULL,
  `period_regime` int(11) DEFAULT NULL,
  `period_num` int(11) DEFAULT NULL,
  `year_id` int(11) DEFAULT NULL,
  `period_lln` tinyint(1) NOT NULL DEFAULT 1,
  `period_doc` tinyint(1) NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `ptas`
--

CREATE TABLE `ptas` (
  `pta_id` int(11) NOT NULL,
  `pta_period` int(11) NOT NULL DEFAULT 0,
  `pta_tp` varchar(2) NOT NULL,
  `pta_leerjr` int(11) NOT NULL,
  `pta_target` varchar(2) NOT NULL DEFAULT '',
  `year_id` int(11) NOT NULL DEFAULT 0,
  `subj_id` int(11) NOT NULL DEFAULT 0,
  `stdher` tinyint(1) NOT NULL DEFAULT 1,
  `stvt` varchar(32) NOT NULL DEFAULT 'ST',
  `shortdesc` varchar(32) NOT NULL DEFAULT '',
  `lokaaleis` enum('THEORIELOKAAL','COMPUTERLOKAAL','KIJKLUISTERLOKAAL') NOT NULL DEFAULT 'THEORIELOKAAL',
  `toetsversie` varchar(32) NOT NULL DEFAULT '',
  `inhaalregime` tinyint(1) NOT NULL DEFAULT 0,
  `toetsduur` int(11) NOT NULL DEFAULT 100
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `regimes`
--

CREATE TABLE `regimes` (
  `regime_id` int(11) NOT NULL,
  `regime_desc` varchar(128) COLLATE utf8mb4_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `reserves`
--

CREATE TABLE `reserves` (
  `reserve_id` int(11) NOT NULL,
  `reserve` varchar(64) NOT NULL,
  `reserve_order` int(11) NOT NULL,
  `moment_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `rex`
--

CREATE TABLE `rex` (
  `rex_id` int(11) NOT NULL,
  `prev_rex_id` int(11) DEFAULT NULL,
  `period_id` int(11) DEFAULT NULL,
  `ppl_id` int(11) DEFAULT NULL,
  `pta_id` int(11) DEFAULT NULL,
  `timestamp` int(11) DEFAULT NULL,
  `subj_id` int(11) DEFAULT 0,
  `info` varchar(256) DEFAULT 'BUG',
  `weight` int(11) NOT NULL DEFAULT 1,
  `fixed` tinyint(1) NOT NULL DEFAULT 0,
  `gemaakt` tinyint(1) NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `rooster`
--

CREATE TABLE `rooster` (
  `rooster_id` int(11) NOT NULL,
  `period_id` int(11) NOT NULL,
  `pta_id` int(11) NOT NULL,
  `moment_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `roosterdetail`
--

CREATE TABLE `roosterdetail` (
  `roosterdetail_id` int(11) NOT NULL,
  `rooster_id` int(11) NOT NULL,
  `moment_id` int(11) NOT NULL,
  `momentlocation_id` int(11) DEFAULT NULL,
  `date` date NOT NULL,
  `time_start` time NOT NULL,
  `time_end` time NOT NULL,
  `pta_id` int(11) DEFAULT NULL,
  `grp_id` int(11) DEFAULT NULL,
  `activiteit` varchar(128) NOT NULL,
  `lok` varchar(64) DEFAULT NULL,
  `surv` varchar(256) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `rooster_ids`
--

CREATE TABLE `rooster_ids` (
  `rooster_id` int(11) NOT NULL,
  `rooster_timestamp` timestamp NOT NULL DEFAULT current_timestamp(),
  `period_id` int(11) NOT NULL,
  `rooster_version` int(11) NOT NULL,
  `rooster_visible` int(11) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `rules`
--

CREATE TABLE `rules` (
  `rule_id` int(11) NOT NULL,
  `regime_id` int(11) NOT NULL,
  `rule_leerjr` int(11) NOT NULL,
  `rule_target` varchar(2) COLLATE utf8mb4_unicode_ci NOT NULL,
  `rule_tp` int(11) DEFAULT NULL,
  `rule_max` int(11) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `survinfos`
--

CREATE TABLE `survinfos` (
  `survinfo_id` int(11) NOT NULL,
  `roosterdetail_id` int(11) NOT NULL,
  `surv` varchar(16) COLLATE utf8mb4_unicode_ci NOT NULL,
  `start` time NOT NULL,
  `end` time NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Indexes for dumped tables
--

--
-- Indexes for table `buitenbeschouwing`
--
ALTER TABLE `buitenbeschouwing`
  ADD PRIMARY KEY (`buitenbeschouwing_id`),
  ADD UNIQUE KEY `period_id` (`period_id`,`pta_id`);

--
-- Indexes for table `config`
--
ALTER TABLE `config`
  ADD PRIMARY KEY (`config_id`),
  ADD UNIQUE KEY `config_target` (`config_target`,`config_key`);

--
-- Indexes for table `constateringen`
--
ALTER TABLE `constateringen`
  ADD PRIMARY KEY (`constatering_id`),
  ADD KEY `rex_id` (`rex_id`);

--
-- Indexes for table `exceptions`
--
ALTER TABLE `exceptions`
  ADD PRIMARY KEY (`exception_id`);

--
-- Indexes for table `files`
--
ALTER TABLE `files`
  ADD PRIMARY KEY (`file_id`);

--
-- Indexes for table `groepeer`
--
ALTER TABLE `groepeer`
  ADD PRIMARY KEY (`groepeer_id`),
  ADD UNIQUE KEY `pta_id` (`pta_id`),
  ADD KEY `group_id` (`group_id`);

--
-- Indexes for table `group_ids`
--
ALTER TABLE `group_ids`
  ADD PRIMARY KEY (`group_id`),
  ADD UNIQUE KEY `period_id` (`period_id`,`group_name`);

--
-- Indexes for table `log`
--
ALTER TABLE `log`
  ADD PRIMARY KEY (`log_id`),
  ADD KEY `log_euid` (`log_euid`),
  ADD KEY `log_uid` (`log_uid`),
  ADD KEY `log_ip` (`log_ip`),
  ADD KEY `log_session` (`log_session`);

--
-- Indexes for table `momentlocations`
--
ALTER TABLE `momentlocations`
  ADD PRIMARY KEY (`momentlocation_id`),
  ADD KEY `moment_id` (`moment_id`);

--
-- Indexes for table `moments`
--
ALTER TABLE `moments`
  ADD PRIMARY KEY (`moment_id`);

--
-- Indexes for table `newdetailrooster`
--
ALTER TABLE `newdetailrooster`
  ADD PRIMARY KEY (`newdetailrooster_id`),
  ADD UNIQUE KEY `grp_id_2` (`grp_id`,`rooster_id`),
  ADD KEY `momentlocation_id` (`momentlocation_id`),
  ADD KEY `grp_id` (`grp_id`),
  ADD KEY `rooster_id` (`rooster_id`);

--
-- Indexes for table `paper`
--
ALTER TABLE `paper`
  ADD PRIMARY KEY (`paper_id`);

--
-- Indexes for table `period2grp`
--
ALTER TABLE `period2grp`
  ADD UNIQUE KEY `UQ__period2g__8C6AE0F82E1BDC42` (`period_id`,`grp_id`),
  ADD KEY `period2grp0` (`period_id`),
  ADD KEY `period2grp1` (`grp_id`);

--
-- Indexes for table `period2maxflags`
--
ALTER TABLE `period2maxflags`
  ADD PRIMARY KEY (`period2maxflags_id`);

--
-- Indexes for table `period2selectable`
--
ALTER TABLE `period2selectable`
  ADD PRIMARY KEY (`period2selectable_id`),
  ADD UNIQUE KEY `period_id` (`period_id`,`pta_id`);

--
-- Indexes for table `periods`
--
ALTER TABLE `periods`
  ADD PRIMARY KEY (`period_id`);

--
-- Indexes for table `ptas`
--
ALTER TABLE `ptas`
  ADD PRIMARY KEY (`pta_id`),
  ADD UNIQUE KEY `pta_period_2` (`pta_target`,`year_id`,`subj_id`,`stvt`,`shortdesc`,`toetsversie`,`pta_tp`,`pta_leerjr`) USING BTREE;

--
-- Indexes for table `regimes`
--
ALTER TABLE `regimes`
  ADD PRIMARY KEY (`regime_id`);

--
-- Indexes for table `reserves`
--
ALTER TABLE `reserves`
  ADD PRIMARY KEY (`reserve_id`),
  ADD UNIQUE KEY `reserve_order` (`reserve_order`,`moment_id`);

--
-- Indexes for table `rex`
--
ALTER TABLE `rex`
  ADD PRIMARY KEY (`rex_id`),
  ADD UNIQUE KEY `UQ__rex__5F1E626022AA2996` (`ppl_id`,`pta_id`,`period_id`),
  ADD KEY `rex0` (`ppl_id`,`period_id`),
  ADD KEY `rex1` (`subj_id`,`period_id`),
  ADD KEY `rex2` (`period_id`),
  ADD KEY `pta_id` (`pta_id`);

--
-- Indexes for table `rooster`
--
ALTER TABLE `rooster`
  ADD PRIMARY KEY (`rooster_id`),
  ADD UNIQUE KEY `pta_id` (`period_id`,`pta_id`),
  ADD KEY `moment_id` (`moment_id`);

--
-- Indexes for table `roosterdetail`
--
ALTER TABLE `roosterdetail`
  ADD PRIMARY KEY (`roosterdetail_id`),
  ADD KEY `rooster_id` (`rooster_id`);

--
-- Indexes for table `rooster_ids`
--
ALTER TABLE `rooster_ids`
  ADD PRIMARY KEY (`rooster_id`),
  ADD KEY `period_id` (`period_id`);

--
-- Indexes for table `rules`
--
ALTER TABLE `rules`
  ADD PRIMARY KEY (`rule_id`);

--
-- Indexes for table `survinfos`
--
ALTER TABLE `survinfos`
  ADD PRIMARY KEY (`survinfo_id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `buitenbeschouwing`
--
ALTER TABLE `buitenbeschouwing`
  MODIFY `buitenbeschouwing_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `config`
--
ALTER TABLE `config`
  MODIFY `config_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `constateringen`
--
ALTER TABLE `constateringen`
  MODIFY `constatering_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `exceptions`
--
ALTER TABLE `exceptions`
  MODIFY `exception_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `files`
--
ALTER TABLE `files`
  MODIFY `file_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `groepeer`
--
ALTER TABLE `groepeer`
  MODIFY `groepeer_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `group_ids`
--
ALTER TABLE `group_ids`
  MODIFY `group_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `log`
--
ALTER TABLE `log`
  MODIFY `log_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `momentlocations`
--
ALTER TABLE `momentlocations`
  MODIFY `momentlocation_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `moments`
--
ALTER TABLE `moments`
  MODIFY `moment_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `newdetailrooster`
--
ALTER TABLE `newdetailrooster`
  MODIFY `newdetailrooster_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `paper`
--
ALTER TABLE `paper`
  MODIFY `paper_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `period2maxflags`
--
ALTER TABLE `period2maxflags`
  MODIFY `period2maxflags_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `period2selectable`
--
ALTER TABLE `period2selectable`
  MODIFY `period2selectable_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `periods`
--
ALTER TABLE `periods`
  MODIFY `period_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `ptas`
--
ALTER TABLE `ptas`
  MODIFY `pta_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `regimes`
--
ALTER TABLE `regimes`
  MODIFY `regime_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `reserves`
--
ALTER TABLE `reserves`
  MODIFY `reserve_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `rex`
--
ALTER TABLE `rex`
  MODIFY `rex_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `rooster`
--
ALTER TABLE `rooster`
  MODIFY `rooster_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `roosterdetail`
--
ALTER TABLE `roosterdetail`
  MODIFY `roosterdetail_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `rooster_ids`
--
ALTER TABLE `rooster_ids`
  MODIFY `rooster_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `rules`
--
ALTER TABLE `rules`
  MODIFY `rule_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `survinfos`
--
ALTER TABLE `survinfos`
  MODIFY `survinfo_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `constateringen`
--
ALTER TABLE `constateringen`
  ADD CONSTRAINT `constateringen_ibfk_1` FOREIGN KEY (`rex_id`) REFERENCES `rex` (`rex_id`);

--
-- Constraints for table `groepeer`
--
ALTER TABLE `groepeer`
  ADD CONSTRAINT `groepeer_ibfk_1` FOREIGN KEY (`group_id`) REFERENCES `group_ids` (`group_id`) ON DELETE CASCADE;

--
-- Constraints for table `momentlocations`
--
ALTER TABLE `momentlocations`
  ADD CONSTRAINT `momentlocations_ibfk_1` FOREIGN KEY (`moment_id`) REFERENCES `moments` (`moment_id`);

--
-- Constraints for table `newdetailrooster`
--
ALTER TABLE `newdetailrooster`
  ADD CONSTRAINT `newdetailrooster_ibfk_1` FOREIGN KEY (`momentlocation_id`) REFERENCES `momentlocations` (`momentlocation_id`) ON UPDATE NO ACTION,
  ADD CONSTRAINT `newdetailrooster_ibfk_2` FOREIGN KEY (`rooster_id`) REFERENCES `rooster` (`rooster_id`);

--
-- Constraints for table `rex`
--
ALTER TABLE `rex`
  ADD CONSTRAINT `rex_ibfk_1` FOREIGN KEY (`pta_id`) REFERENCES `ptas` (`pta_id`);

--
-- Constraints for table `rooster`
--
ALTER TABLE `rooster`
  ADD CONSTRAINT `rooster_ibfk_1` FOREIGN KEY (`moment_id`) REFERENCES `moments` (`moment_id`) ON UPDATE NO ACTION;
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 */;
