Commit c6855de8 authored by Mārcis Koloda's avatar Mārcis Koloda
Browse files

Pievienota datubāze, komentāri

parent 46b731b1
-- phpMyAdmin SQL Dump
-- version 4.5.4.1deb2ubuntu2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: May 22, 2017 at 10:47 AM
-- Server version: 5.7.17-0ubuntu0.16.04.1
-- PHP Version: 7.0.15-0ubuntu0.16.04.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
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: `komentari`
--
CREATE DATABASE IF NOT EXISTS `komentari` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
USE `komentari`;
-- --------------------------------------------------------
--
-- Table structure for table `komentari`
--
CREATE TABLE `komentari` (
`ID` int(11) NOT NULL,
`autors` varchar(65) NOT NULL,
`teksts` text NOT NULL,
`datums` varchar(45) NOT NULL,
`raksti_ID` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `komentari`
--
INSERT INTO `komentari` (`ID`, `autors`, `teksts`, `datums`, `raksti_ID`) VALUES
(1, 'Antons Spainis', 'Kā pārbaudīt nieres tehnisko stāvokli? ', '2017-05-22 10:46:54', 1);
-- --------------------------------------------------------
--
-- Table structure for table `raksti`
--
CREATE TABLE `raksti` (
`ID` int(11) NOT NULL,
`teksts` text NOT NULL,
`nosaukums` varchar(200) NOT NULL,
`datums` varchar(45) NOT NULL,
`autors` varchar(65) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `raksti`
--
INSERT INTO `raksti` (`ID`, `teksts`, `nosaukums`, `datums`, `autors`) VALUES
(1, 'Pārdod mazliet lietotu, bet kvalitatīvu nieri. Gandrīz visu mūžu ir dzīvojusi taukos.. \r\n\r\nCena: 250 000 eiro. ', 'Pārdod nieri', '2017-05-22 10:46:04', 'Alfrēds Kāpostgalva');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `komentari`
--
ALTER TABLE `komentari`
ADD PRIMARY KEY (`ID`),
ADD KEY `fk_komentari_raksti_idx` (`raksti_ID`);
--
-- Indexes for table `raksti`
--
ALTER TABLE `raksti`
ADD PRIMARY KEY (`ID`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `komentari`
--
ALTER TABLE `komentari`
MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `raksti`
--
ALTER TABLE `raksti`
MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `komentari`
--
ALTER TABLE `komentari`
ADD CONSTRAINT `fk_komentari_raksti` FOREIGN KEY (`raksti_ID`) REFERENCES `raksti` (`ID`) ON DELETE NO ACTION ON UPDATE NO ACTION;
/*!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 */;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment