CREATE DATABASE  IF NOT EXISTS `luka` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `luka`;
-- MySQL dump 10.13  Distrib 5.7.17, for Win64 (x86_64)
--
-- Host: 127.0.0.1    Database: luka
-- ------------------------------------------------------
-- Server version	5.7.20-log

/*!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 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `brod`
--

DROP TABLE IF EXISTS `brod`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `brod` (
  `ime` varchar(45) NOT NULL,
  `kapacitet` int(11) DEFAULT NULL,
  `brzina` int(11) DEFAULT NULL,
  `kapetan` varchar(45) DEFAULT NULL,
  PRIMARY KEY (`ime`),
  KEY `kapetanBrod_idx` (`kapetan`),
  CONSTRAINT `kapetanBrod` FOREIGN KEY (`kapetan`) REFERENCES `korisnik` (`username`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `brod`
--

LOCK TABLES `brod` WRITE;
/*!40000 ALTER TABLE `brod` DISABLE KEYS */;
INSERT INTO `brod` VALUES ('Basti',30,50,'anci'),('Bilja',50,40,'janko'),('Emili',30,40,'janko'),('Jeca',20,30,'nole'),('Stefan',90,45,'nole'),('Tara',60,40,'nole');
/*!40000 ALTER TABLE `brod` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `brodkapija`
--

DROP TABLE IF EXISTS `brodkapija`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `brodkapija` (
  `brod` varchar(45) NOT NULL,
  `kapija` int(11) NOT NULL,
  `status` varchar(45) DEFAULT NULL,
  PRIMARY KEY (`brod`,`kapija`),
  KEY `kapija_idx` (`kapija`),
  CONSTRAINT `brod` FOREIGN KEY (`brod`) REFERENCES `brod` (`ime`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `kapija` FOREIGN KEY (`kapija`) REFERENCES `kapije` (`idk`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `brodkapija`
--

LOCK TABLES `brodkapija` WRITE;
/*!40000 ALTER TABLE `brodkapija` DISABLE KEYS */;
INSERT INTO `brodkapija` VALUES ('Basti',2,'Cekanje'),('Jeca',1,'Cekanje');
/*!40000 ALTER TABLE `brodkapija` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `kapije`
--

DROP TABLE IF EXISTS `kapije`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `kapije` (
  `idk` int(11) NOT NULL,
  `naziv` varchar(45) DEFAULT NULL,
  PRIMARY KEY (`idk`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `kapije`
--

LOCK TABLES `kapije` WRITE;
/*!40000 ALTER TABLE `kapije` DISABLE KEYS */;
INSERT INTO `kapije` VALUES (1,'A1'),(2,'A2'),(3,'B1'),(4,'B2'),(5,'B3');
/*!40000 ALTER TABLE `kapije` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `korisnik`
--

DROP TABLE IF EXISTS `korisnik`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `korisnik` (
  `ime` varchar(45) DEFAULT NULL,
  `prezime` varchar(45) DEFAULT NULL,
  `username` varchar(45) NOT NULL,
  `password` varchar(45) DEFAULT NULL,
  `tip` varchar(45) DEFAULT NULL,
  PRIMARY KEY (`username`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `korisnik`
--

LOCK TABLES `korisnik` WRITE;
/*!40000 ALTER TABLE `korisnik` DISABLE KEYS */;
INSERT INTO `korisnik` VALUES ('Admin','Adminovic','admin','admin123','sef'),('Ana','Ivanovic','anci','anci123','kapetan'),('Janko','Tipsarevic','janko','janko123','kapetan'),('Novak','Djokovic','nole','nole123','kapetan');
/*!40000 ALTER TABLE `korisnik` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!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 */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2018-05-09 19:58:11
