Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE DATABASE IF NOT EXISTS `forum` /*!40100 DEFAULT CHARACTER SET utf8 */;
- USE `forum`;
- -- MySQL dump 10.13 Distrib 5.6.17, for Win32 (x86)
- --
- -- Host: localhost Database: mvc
- -- ------------------------------------------------------
- -- Server version 5.6.21
- /*!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 `users`
- --
- DROP TABLE IF EXISTS `users`;
- /*!40101 SET @saved_cs_client = @@character_set_client */;
- /*!40101 SET character_set_client = utf8 */;
- CREATE TABLE `users` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `username` varchar(45) NOT NULL,
- `pass_hash` varchar(60) NOT NULL,
- `is_admin` bit(1) NOT NULL DEFAULT b'0',
- PRIMARY KEY (`id`),
- UNIQUE KEY `username_UNIQUE` (`username`)
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
- /*!40101 SET character_set_client = @saved_cs_client */;
- --
- -- Dumping data for table `users`
- --
- LOCK TABLES `users` WRITE;
- /*!40000 ALTER TABLE `users` DISABLE KEYS */;
- /*!40000 ALTER TABLE `users` 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 */;
- --
- -- Table structure for table `questions`
- --
- DROP TABLE IF EXISTS `questions`;
- /*!40101 SET @saved_cs_client = @@character_set_client */;
- /*!40101 SET character_set_client = utf8 */;
- CREATE TABLE `questions` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `text` varchar(300) NOT NULL,
- `user_id` int(11) DEFAULT NULL,
- `category_id` int(11) DEFAULT NULL,
- PRIMARY KEY (`id`),
- KEY `fk_users_questions_idx` (`user_id`),
- CONSTRAINT `fk_users_questions` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
- KEY `fk_categories_questions_idx` (`category_id`),
- CONSTRAINT `fk_categories_questions` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
- ) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=utf8;
- /*!40101 SET character_set_client = @saved_cs_client */;
- --
- -- Dumping data for table `authors`
- --
- LOCK TABLES `authors` WRITE;
- /*!40000 ALTER TABLE `authors` DISABLE KEYS */;
- INSERT INTO `authors` VALUES (1,'Pesho'),(2,'Kiro'),(3,'Maria'),(6,'Nakov');
- /*!40000 ALTER TABLE `authors` ENABLE KEYS */;
- UNLOCK TABLES;
- --
- -- Table structure for table `books`
- --
- DROP TABLE IF EXISTS `books`;
- /*!40101 SET @saved_cs_client = @@character_set_client */;
- /*!40101 SET character_set_client = utf8 */;
- CREATE TABLE `books` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `title` varchar(200) NOT NULL,
- `isbn` varchar(20) DEFAULT NULL,
- `url` varchar(200) DEFAULT NULL,
- `author_id` int(11) DEFAULT NULL,
- PRIMARY KEY (`id`),
- KEY `fk_books_authors_idx` (`author_id`),
- CONSTRAINT `fk_books_authors` FOREIGN KEY (`author_id`) REFERENCES `authors` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
- ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
- /*!40101 SET character_set_client = @saved_cs_client */;
- --
- -- Dumping data for table `books`
- --
- LOCK TABLES `books` WRITE;
- /*!40000 ALTER TABLE `books` DISABLE KEYS */;
- INSERT INTO `books` VALUES (1,'PHP for Dummies',NULL,NULL,NULL),(2,'PHP for Beginners','123-456-789',NULL,1),(3,'PHP Quick Start',NULL,'http://php.net',2);
- /*!40000 ALTER TABLE `books` ENABLE KEYS */;
- UNLOCK TABLES;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement