-- --------------------------------------------------------
-- Host:                         127.0.0.1
-- Server version:               10.4.25-MariaDB - mariadb.org binary distribution
-- Server OS:                    Win64
-- HeidiSQL Version:             12.4.0.6659
-- --------------------------------------------------------

/*!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 database structure for galerija_rihards
/*CREATE DATABASE IF NOT EXISTS `galerija_rihards` /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci */;
/*USE `galerija_rihards`;*/

-- Dumping structure for table galerija_rihards.rs_autors
CREATE TABLE IF NOT EXISTS `rs_autors` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `vards` varchar(100) COLLATE utf8_unicode_ci NOT NULL COMMENT 'autora vārds',
  `uzvards` varchar(50) COLLATE utf8_unicode_ci NOT NULL COMMENT 'autora uzvārds',
  `vecums` varchar(100) COLLATE utf8_unicode_ci NOT NULL COMMENT 'autora vecums',
  `email` varchar(50) COLLATE utf8_unicode_ci NOT NULL COMMENT 'autora e-pasts',
  `parole` varchar(50) COLLATE utf8_unicode_ci NOT NULL COMMENT 'autora parole',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

-- Dumping structure for table galerija_rihards.rs_foto
CREATE TABLE IF NOT EXISTS `rs_foto` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `foto` longblob NOT NULL COMMENT 'foto',
  `nos` varchar(100) COLLATE utf8_unicode_ci NOT NULL COMMENT 'foto nosaukums',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

-- Dumping structure for table galerija_rihards.rs_galerija
CREATE TABLE IF NOT EXISTS `rs_galerija` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `id_foto` int(10) unsigned NOT NULL,
  `id_autors` int(10) unsigned NOT NULL,
  PRIMARY KEY (`id`),
  KEY `FK1_galerija_foto` (`id_foto`),
  KEY `FK2_galerija_autors` (`id_autors`),
  CONSTRAINT `FK1_galerija_foto` FOREIGN KEY (`id_foto`) REFERENCES `rs_foto` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `FK2_galerija_autors` FOREIGN KEY (`id_autors`) REFERENCES `rs_autors` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- Dumping data for table galerija_rihards.rs_galerija: ~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) */;
