-- --------------------------------------------------------
-- Host:                         127.0.0.1
-- Server version:               10.1.29-MariaDB - mariadb.org binary distribution
-- Server OS:                    Win32
-- HeidiSQL Version:             12.1.0.6537
-- --------------------------------------------------------

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8 */;
/*!50503 SET NAMES utf8mb4 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!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 */;

-- Dumping structure for table gl_noliktava.gl_mervienibas
CREATE TABLE IF NOT EXISTS `gl_mervienibas` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `nosaukums` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- Dumping data for table gl_noliktava.gl_mervienibas: ~0 rows (approximately)

-- Dumping structure for table gl_noliktava.gl_noliktava
CREATE TABLE IF NOT EXISTS `gl_noliktava` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `preces_id` int(11) DEFAULT NULL,
  `cena` decimal(6,2) DEFAULT NULL,
  `datums` date DEFAULT NULL,
  `uznemejs` int(11) DEFAULT NULL,
  `serijas_nr` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  `skaits` int(11) DEFAULT NULL,
  `mer_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `FK_gl_noliktava_gl_prece` (`preces_id`),
  KEY `FK_gl_noliktava_gl_uznemejs` (`uznemejs`),
  KEY `FK_gl_noliktava_gl_mervienibas` (`mer_id`),
  CONSTRAINT `FK_gl_noliktava_gl_mervienibas` FOREIGN KEY (`mer_id`) REFERENCES `gl_mervienibas` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `FK_gl_noliktava_gl_prece` FOREIGN KEY (`preces_id`) REFERENCES `gl_prece` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `FK_gl_noliktava_gl_uznemejs` FOREIGN KEY (`uznemejs`) REFERENCES `gl_uznemejs` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- Dumping data for table gl_noliktava.gl_noliktava: ~0 rows (approximately)

-- Dumping structure for table gl_noliktava.gl_prece
CREATE TABLE IF NOT EXISTS `gl_prece` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `nosaukums` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  `kods` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- Dumping data for table gl_noliktava.gl_prece: ~0 rows (approximately)

-- Dumping structure for table gl_noliktava.gl_uznemejs
CREATE TABLE IF NOT EXISTS `gl_uznemejs` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `vards` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  `uzvards` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  `statuss` int(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- Dumping data for table gl_noliktava.gl_uznemejs: ~0 rows (approximately)

/*!40103 SET TIME_ZONE=IFNULL(@OLD_TIME_ZONE, 'system') */;
/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
/*!40014 SET FOREIGN_KEY_CHECKS=IFNULL(@OLD_FOREIGN_KEY_CHECKS, 1) */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40111 SET SQL_NOTES=IFNULL(@OLD_SQL_NOTES, 1) */;
