-- phpMyAdmin SQL Dump
-- version 3.3.7deb8
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Apr 09, 2015 at 05:26 PM
-- Server version: 5.1.73
-- PHP Version: 5.3.3-7+squeeze23

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";


/*!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 utf8 */;

--
-- Database: `jaagup_2015`
--

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

--
-- Table structure for table `a24s_asukohad`
--

CREATE TABLE IF NOT EXISTS `a24s_asukohad` (
  `asukoht` varchar(45) NOT NULL,
  PRIMARY KEY (`asukoht`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `a24s_asukohad`
--

INSERT INTO `a24s_asukohad` (`asukoht`) VALUES
('Haapsalu'),
('Tallinn');

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

--
-- Table structure for table `a24s_kaigukastityybid`
--

CREATE TABLE IF NOT EXISTS `a24s_kaigukastityybid` (
  `kaigukastityyp` varchar(45) NOT NULL,
  PRIMARY KEY (`kaigukastityyp`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `a24s_kaigukastityybid`
--

INSERT INTO `a24s_kaigukastityybid` (`kaigukastityyp`) VALUES
('automaat'),
('manuaal');

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

--
-- Table structure for table `a24s_keretyybid`
--

CREATE TABLE IF NOT EXISTS `a24s_keretyybid` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `tyybinimi` varchar(45) NOT NULL,
  `soidukityyp` varchar(45) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `fk_a24s_keretyybid_a24s_soidukityybid1_idx` (`soidukityyp`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;

--
-- Dumping data for table `a24s_keretyybid`
--

INSERT INTO `a24s_keretyybid` (`id`, `tyybinimi`, `soidukityyp`) VALUES
(1, 'sedaan', 'sõiduauto'),
(2, 'universaal', 'sõiduauto');

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

--
-- Table structure for table `a24s_kommentaarid`
--

CREATE TABLE IF NOT EXISTS `a24s_kommentaarid` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `sisu` varchar(255) NOT NULL,
  `autor` varchar(45) NOT NULL,
  `aeg` datetime NOT NULL,
  `uudise_id` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `fk_a24s_kommentaarid_a24s_uudised1_idx` (`uudise_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

--
-- Dumping data for table `a24s_kommentaarid`
--


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

--
-- Table structure for table `a24s_kytusetyybid`
--

CREATE TABLE IF NOT EXISTS `a24s_kytusetyybid` (
  `kytusetyyp` varchar(45) NOT NULL,
  PRIMARY KEY (`kytusetyyp`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `a24s_kytusetyybid`
--

INSERT INTO `a24s_kytusetyybid` (`kytusetyyp`) VALUES
('bensiin'),
('diisel');

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

--
-- Table structure for table `a24s_lisakontaktid`
--

CREATE TABLE IF NOT EXISTS `a24s_lisakontaktid` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `myyja_knimi` varchar(45) NOT NULL,
  `lyhikirjeldus` varchar(45) NOT NULL,
  `telefon` varchar(45) DEFAULT NULL,
  `epost` varchar(45) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `fk_a24s_lisakontaktid_a24s_myyjad1_idx` (`myyja_knimi`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

--
-- Dumping data for table `a24s_lisakontaktid`
--


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

--
-- Table structure for table `a24s_margid`
--

CREATE TABLE IF NOT EXISTS `a24s_margid` (
  `mark` varchar(45) NOT NULL,
  PRIMARY KEY (`mark`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `a24s_margid`
--

INSERT INTO `a24s_margid` (`mark`) VALUES
('Opel'),
('Volkswagen');

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

--
-- Table structure for table `a24s_mudelid`
--

CREATE TABLE IF NOT EXISTS `a24s_mudelid` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `mudel` varchar(45) NOT NULL,
  `marginimi` varchar(45) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `fk_a24s_mudelid_a24s_margid1_idx` (`marginimi`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;

--
-- Dumping data for table `a24s_mudelid`
--

INSERT INTO `a24s_mudelid` (`id`, `mudel`, `marginimi`) VALUES
(1, 'Passat', 'Volkswagen'),
(2, 'Touran', 'Volkswagen'),
(3, 'Kadett', 'Opel'),
(4, 'Astra', 'Opel');

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

--
-- Table structure for table `a24s_myyjad`
--

CREATE TABLE IF NOT EXISTS `a24s_myyjad` (
  `knimi` varchar(45) NOT NULL,
  `paroorir2si` char(41) DEFAULT NULL,
  `telefon` varchar(45) DEFAULT NULL,
  `epost` varchar(45) DEFAULT NULL,
  `faks` varchar(45) DEFAULT NULL,
  `registrikood` varchar(45) DEFAULT NULL,
  `kmkr` varchar(45) DEFAULT NULL,
  `aadress` varchar(255) DEFAULT NULL,
  `koduleht` varchar(45) DEFAULT NULL,
  `lahtiolekuajad` varchar(45) DEFAULT NULL,
  `kirjeldus` text,
  `ikooni_id` int(11) DEFAULT NULL,
  `kirjelduse_pildi_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`knimi`),
  KEY `fk_a24s_myyjad_a24s_pildid1_idx` (`ikooni_id`),
  KEY `fk_a24s_myyjad_a24s_pildid2_idx` (`kirjelduse_pildi_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `a24s_myyjad`
--

INSERT INTO `a24s_myyjad` (`knimi`, `paroorir2si`, `telefon`, `epost`, `faks`, `registrikood`, `kmkr`, `aadress`, `koduleht`, `lahtiolekuajad`, `kirjeldus`, `ikooni_id`, `kirjelduse_pildi_id`) VALUES
('juku', '*C25867096CC67DD77ACB514CE80CC1B06A9438BF', '12345', 'juku@eesti.ee', '23456', '1234567', '223456', 'Kauba 5, Kuressaare', 'http://www.juku.ee/', 'E-R 10-20', 'Autode komisjonimüük', NULL, NULL);

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

--
-- Table structure for table `a24s_myyjad_teenused`
--

CREATE TABLE IF NOT EXISTS `a24s_myyjad_teenused` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `myyja_knimi` varchar(45) NOT NULL,
  `teenuse_alamtyyp` varchar(45) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `fk_a24s_myyjad_teenused_a24s_myyjad1_idx` (`myyja_knimi`),
  KEY `fk_a24s_myyjad_teenused_a24_teenuse_alamtyybid1_idx` (`teenuse_alamtyyp`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

--
-- Dumping data for table `a24s_myyjad_teenused`
--


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

--
-- Table structure for table `a24s_pildid`
--

CREATE TABLE IF NOT EXISTS `a24s_pildid` (
  `id` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `a24s_pildid`
--

INSERT INTO `a24s_pildid` (`id`) VALUES
(1),
(2);

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

--
-- Table structure for table `a24s_sillatyybid`
--

CREATE TABLE IF NOT EXISTS `a24s_sillatyybid` (
  `sillatyyp` varchar(45) NOT NULL,
  PRIMARY KEY (`sillatyyp`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `a24s_sillatyybid`
--

INSERT INTO `a24s_sillatyybid` (`sillatyyp`) VALUES
('esisild'),
('tagasild');

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

--
-- Table structure for table `a24s_soidukid`
--

CREATE TABLE IF NOT EXISTS `a24s_soidukid` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `keretyybi_id` int(11) NOT NULL,
  `mudeli_id` int(11) NOT NULL,
  `myyja` varchar(45) NOT NULL,
  `hind` int(11) NOT NULL,
  `esmanereg` date DEFAULT NULL,
  `varvus` varchar(45) DEFAULT NULL,
  `kytusetyyp` varchar(45) DEFAULT NULL,
  `kaigukastityyp` varchar(45) DEFAULT NULL,
  `asukoht` varchar(45) DEFAULT NULL,
  `sillatyyp` varchar(45) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `fk_a24s_soidukid_a24s_myyjad1_idx` (`myyja`),
  KEY `fk_a24s_soidukid_a24s_keretyybid1_idx` (`keretyybi_id`),
  KEY `fk_a24s_soidukid_a24s_mudelid1_idx` (`mudeli_id`),
  KEY `fk_a24s_soidukid_a24s_varvused1_idx` (`varvus`),
  KEY `fk_a24s_soidukid_a24s_kytusetyybid1_idx` (`kytusetyyp`),
  KEY `fk_a24s_soidukid_a24s_kaigukastityybid1_idx` (`kaigukastityyp`),
  KEY `fk_a24s_soidukid_a24s_asukohad1_idx` (`asukoht`),
  KEY `fk_a24s_soidukid_a24s_sillatyybid1_idx` (`sillatyyp`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;

--
-- Dumping data for table `a24s_soidukid`
--

INSERT INTO `a24s_soidukid` (`id`, `keretyybi_id`, `mudeli_id`, `myyja`, `hind`, `esmanereg`, `varvus`, `kytusetyyp`, `kaigukastityyp`, `asukoht`, `sillatyyp`) VALUES
(1, 2, 4, 'juku', 1456, '2006-04-06', 'sinine', 'bensiin', 'manuaal', 'Haapsalu', 'esisild'),
(2, 2, 4, 'juku', 23000, '2015-04-24', 'punane', 'bensiin', 'automaat', 'Tallinn', 'esisild');

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

--
-- Table structure for table `a24s_soidukid_pildid`
--

CREATE TABLE IF NOT EXISTS `a24s_soidukid_pildid` (
  `soiduki_id` int(11) NOT NULL,
  `pildi_id` int(11) NOT NULL,
  PRIMARY KEY (`soiduki_id`,`pildi_id`),
  KEY `fk_a24s_soidukid_pildid_a24s_pildid1_idx` (`pildi_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `a24s_soidukid_pildid`
--

INSERT INTO `a24s_soidukid_pildid` (`soiduki_id`, `pildi_id`) VALUES
(1, 1),
(2, 2);

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

--
-- Table structure for table `a24s_soidukityybid`
--

CREATE TABLE IF NOT EXISTS `a24s_soidukityybid` (
  `soidukityyp` varchar(45) NOT NULL,
  PRIMARY KEY (`soidukityyp`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `a24s_soidukityybid`
--

INSERT INTO `a24s_soidukityybid` (`soidukityyp`) VALUES
('kaubik'),
('sõiduauto');

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

--
-- Table structure for table `a24s_soiduk_varustus`
--

CREATE TABLE IF NOT EXISTS `a24s_soiduk_varustus` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `soiduki_id` int(11) NOT NULL,
  `varustuse_id` int(11) NOT NULL,
  `kommentaar` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `fk_a24s_soiduk_varustus_a24s_varustus1_idx` (`varustuse_id`),
  KEY `fk_a24s_soiduk_varustus_a24s_soidukid1_idx` (`soiduki_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

--
-- Dumping data for table `a24s_soiduk_varustus`
--


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

--
-- Table structure for table `a24s_teenusetyybid`
--

CREATE TABLE IF NOT EXISTS `a24s_teenusetyybid` (
  `teenusetyyp` varchar(45) NOT NULL,
  PRIMARY KEY (`teenusetyyp`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `a24s_teenusetyybid`
--


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

--
-- Table structure for table `a24s_teenuse_alamtyybid`
--

CREATE TABLE IF NOT EXISTS `a24s_teenuse_alamtyybid` (
  `teenuse_alamtyyp` varchar(45) NOT NULL,
  `teenusetyyp` varchar(45) NOT NULL,
  PRIMARY KEY (`teenuse_alamtyyp`),
  KEY `fk_a24_teenuse_alamtyybid_a24s_teenusetyybid1_idx` (`teenusetyyp`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `a24s_teenuse_alamtyybid`
--


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

--
-- Table structure for table `a24s_uudised`
--

CREATE TABLE IF NOT EXISTS `a24s_uudised` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `pealkiri` varchar(45) NOT NULL,
  `sisu` text NOT NULL,
  `pildi_id` int(11) NOT NULL,
  `rubriik` varchar(45) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `fk_a24s_uudised_a24s_uudiserubriigid1_idx` (`rubriik`),
  KEY `fk_a24s_uudised_a24s_pildid1_idx` (`pildi_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

--
-- Dumping data for table `a24s_uudised`
--


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

--
-- Table structure for table `a24s_uudiserubriigid`
--

CREATE TABLE IF NOT EXISTS `a24s_uudiserubriigid` (
  `rubriik` varchar(45) NOT NULL,
  PRIMARY KEY (`rubriik`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `a24s_uudiserubriigid`
--


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

--
-- Table structure for table `a24s_varustus`
--

CREATE TABLE IF NOT EXISTS `a24s_varustus` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `varustusgrupp` varchar(45) NOT NULL,
  `varustus` varchar(45) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `fk_a24s_varustus_a24s_varustusgrupp1_idx` (`varustusgrupp`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;

--
-- Dumping data for table `a24s_varustus`
--

INSERT INTO `a24s_varustus` (`id`, `varustusgrupp`, `varustus`) VALUES
(1, 'Mootoriõli', 'Mineraalne diiselmootoriõli M10G2'),
(2, 'Autoklaasid', 'Esiklaas VW Touran');

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

--
-- Table structure for table `a24s_varustusgrupp`
--

CREATE TABLE IF NOT EXISTS `a24s_varustusgrupp` (
  `grupinimi` varchar(45) NOT NULL,
  `ylemgrupp` varchar(45) DEFAULT NULL,
  PRIMARY KEY (`grupinimi`),
  KEY `fk_a24s_varustusgrupp_a24s_varustusgrupp1_idx` (`ylemgrupp`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `a24s_varustusgrupp`
--

INSERT INTO `a24s_varustusgrupp` (`grupinimi`, `ylemgrupp`) VALUES
('kaubad', NULL),
('Autoklaasid', 'kaubad'),
('Keemia  ja vedelikud', 'kaubad'),
('Käigukastiõli', 'Keemia  ja vedelikud'),
('Mootoriõli', 'Keemia  ja vedelikud');

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

--
-- Table structure for table `a24s_varvused`
--

CREATE TABLE IF NOT EXISTS `a24s_varvused` (
  `varvus` varchar(45) NOT NULL,
  PRIMARY KEY (`varvus`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `a24s_varvused`
--

INSERT INTO `a24s_varvused` (`varvus`) VALUES
('punane'),
('sinine');

--
-- Constraints for dumped tables
--

--
-- Constraints for table `a24s_keretyybid`
--
ALTER TABLE `a24s_keretyybid`
  ADD CONSTRAINT `fk_a24s_keretyybid_a24s_soidukityybid1` FOREIGN KEY (`soidukityyp`) REFERENCES `a24s_soidukityybid` (`soidukityyp`) ON DELETE NO ACTION ON UPDATE NO ACTION;

--
-- Constraints for table `a24s_kommentaarid`
--
ALTER TABLE `a24s_kommentaarid`
  ADD CONSTRAINT `fk_a24s_kommentaarid_a24s_uudised1` FOREIGN KEY (`uudise_id`) REFERENCES `a24s_uudised` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION;

--
-- Constraints for table `a24s_lisakontaktid`
--
ALTER TABLE `a24s_lisakontaktid`
  ADD CONSTRAINT `fk_a24s_lisakontaktid_a24s_myyjad1` FOREIGN KEY (`myyja_knimi`) REFERENCES `a24s_myyjad` (`knimi`) ON DELETE NO ACTION ON UPDATE NO ACTION;

--
-- Constraints for table `a24s_mudelid`
--
ALTER TABLE `a24s_mudelid`
  ADD CONSTRAINT `fk_a24s_mudelid_a24s_margid1` FOREIGN KEY (`marginimi`) REFERENCES `a24s_margid` (`mark`) ON DELETE NO ACTION ON UPDATE NO ACTION;

--
-- Constraints for table `a24s_myyjad`
--
ALTER TABLE `a24s_myyjad`
  ADD CONSTRAINT `fk_a24s_myyjad_a24s_pildid1` FOREIGN KEY (`ikooni_id`) REFERENCES `a24s_pildid` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  ADD CONSTRAINT `fk_a24s_myyjad_a24s_pildid2` FOREIGN KEY (`kirjelduse_pildi_id`) REFERENCES `a24s_pildid` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION;

--
-- Constraints for table `a24s_myyjad_teenused`
--
ALTER TABLE `a24s_myyjad_teenused`
  ADD CONSTRAINT `fk_a24s_myyjad_teenused_a24s_myyjad1` FOREIGN KEY (`myyja_knimi`) REFERENCES `a24s_myyjad` (`knimi`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  ADD CONSTRAINT `fk_a24s_myyjad_teenused_a24_teenuse_alamtyybid1` FOREIGN KEY (`teenuse_alamtyyp`) REFERENCES `a24s_teenuse_alamtyybid` (`teenuse_alamtyyp`) ON DELETE NO ACTION ON UPDATE NO ACTION;

--
-- Constraints for table `a24s_soidukid`
--
ALTER TABLE `a24s_soidukid`
  ADD CONSTRAINT `fk_a24s_soidukid_a24s_myyjad1` FOREIGN KEY (`myyja`) REFERENCES `a24s_myyjad` (`knimi`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  ADD CONSTRAINT `fk_a24s_soidukid_a24s_keretyybid1` FOREIGN KEY (`keretyybi_id`) REFERENCES `a24s_keretyybid` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  ADD CONSTRAINT `fk_a24s_soidukid_a24s_mudelid1` FOREIGN KEY (`mudeli_id`) REFERENCES `a24s_mudelid` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  ADD CONSTRAINT `fk_a24s_soidukid_a24s_varvused1` FOREIGN KEY (`varvus`) REFERENCES `a24s_varvused` (`varvus`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  ADD CONSTRAINT `fk_a24s_soidukid_a24s_kytusetyybid1` FOREIGN KEY (`kytusetyyp`) REFERENCES `a24s_kytusetyybid` (`kytusetyyp`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  ADD CONSTRAINT `fk_a24s_soidukid_a24s_kaigukastityybid1` FOREIGN KEY (`kaigukastityyp`) REFERENCES `a24s_kaigukastityybid` (`kaigukastityyp`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  ADD CONSTRAINT `fk_a24s_soidukid_a24s_asukohad1` FOREIGN KEY (`asukoht`) REFERENCES `a24s_asukohad` (`asukoht`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  ADD CONSTRAINT `fk_a24s_soidukid_a24s_sillatyybid1` FOREIGN KEY (`sillatyyp`) REFERENCES `a24s_sillatyybid` (`sillatyyp`) ON DELETE NO ACTION ON UPDATE NO ACTION;

--
-- Constraints for table `a24s_soidukid_pildid`
--
ALTER TABLE `a24s_soidukid_pildid`
  ADD CONSTRAINT `fk_a24s_soidukid_pildid_a24s_soidukid1` FOREIGN KEY (`soiduki_id`) REFERENCES `a24s_soidukid` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  ADD CONSTRAINT `fk_a24s_soidukid_pildid_a24s_pildid1` FOREIGN KEY (`pildi_id`) REFERENCES `a24s_pildid` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION;

--
-- Constraints for table `a24s_soiduk_varustus`
--
ALTER TABLE `a24s_soiduk_varustus`
  ADD CONSTRAINT `fk_a24s_soiduk_varustus_a24s_varustus1` FOREIGN KEY (`varustuse_id`) REFERENCES `a24s_varustus` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  ADD CONSTRAINT `fk_a24s_soiduk_varustus_a24s_soidukid1` FOREIGN KEY (`soiduki_id`) REFERENCES `a24s_soidukid` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION;

--
-- Constraints for table `a24s_teenuse_alamtyybid`
--
ALTER TABLE `a24s_teenuse_alamtyybid`
  ADD CONSTRAINT `fk_a24_teenuse_alamtyybid_a24s_teenusetyybid1` FOREIGN KEY (`teenusetyyp`) REFERENCES `a24s_teenusetyybid` (`teenusetyyp`) ON DELETE NO ACTION ON UPDATE NO ACTION;

--
-- Constraints for table `a24s_uudised`
--
ALTER TABLE `a24s_uudised`
  ADD CONSTRAINT `fk_a24s_uudised_a24s_uudiserubriigid1` FOREIGN KEY (`rubriik`) REFERENCES `a24s_uudiserubriigid` (`rubriik`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  ADD CONSTRAINT `fk_a24s_uudised_a24s_pildid1` FOREIGN KEY (`pildi_id`) REFERENCES `a24s_pildid` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION;

--
-- Constraints for table `a24s_varustus`
--
ALTER TABLE `a24s_varustus`
  ADD CONSTRAINT `fk_a24s_varustus_a24s_varustusgrupp1` FOREIGN KEY (`varustusgrupp`) REFERENCES `a24s_varustusgrupp` (`grupinimi`) ON DELETE NO ACTION ON UPDATE NO ACTION;

--
-- Constraints for table `a24s_varustusgrupp`
--
ALTER TABLE `a24s_varustusgrupp`
  ADD CONSTRAINT `fk_a24s_varustusgrupp_a24s_varustusgrupp1` FOREIGN KEY (`ylemgrupp`) REFERENCES `a24s_varustusgrupp` (`grupinimi`) ON DELETE NO ACTION ON UPDATE NO ACTION;
