· 8 years ago · Dec 20, 2017, 01:38 PM
1-- --------------------------------------------------------
2-- Host: 127.0.0.1
3-- Server version: 10.1.21-MariaDB - mariadb.org binary distribution
4-- Server OS: Win32
5-- HeidiSQL Version: 9.4.0.5125
6-- --------------------------------------------------------
7
8/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
9/*!40101 SET NAMES utf8 */;
10/*!50503 SET NAMES utf8mb4 */;
11/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
12/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
13
14
15-- Dumping database structure for toolsforever
16CREATE DATABASE IF NOT EXISTS `toolsforever` /*!40100 DEFAULT CHARACTER SET latin1 */;
17USE `toolsforever`;
18
19-- Dumping structure for table toolsforever.locations
20CREATE TABLE IF NOT EXISTS `locations` (
21 `id` int(11) NOT NULL AUTO_INCREMENT,
22 `name` varchar(50) DEFAULT NULL,
23 PRIMARY KEY (`id`)
24) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1;
25
26-- Dumping data for table toolsforever.locations: ~3 rows (approximately)
27DELETE FROM `locations`;
28/*!40000 ALTER TABLE `locations` DISABLE KEYS */;
29/*!40000 ALTER TABLE `locations` ENABLE KEYS */;
30
31-- Dumping structure for table toolsforever.products
32CREATE TABLE IF NOT EXISTS `products` (
33 `id` int(11) NOT NULL AUTO_INCREMENT,
34 `name` varchar(50) DEFAULT NULL,
35 `price` double DEFAULT NULL,
36 PRIMARY KEY (`id`)
37) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
38
39-- Dumping data for table toolsforever.products: ~2 rows (approximately)
40DELETE FROM `products`;
41/*!40000 ALTER TABLE `products` DISABLE KEYS */;
42/*!40000 ALTER TABLE `products` ENABLE KEYS */;
43
44-- Dumping structure for table toolsforever.product_locations
45CREATE TABLE IF NOT EXISTS `product_locations` (
46 `product_id` int(11) NOT NULL,
47 `location_id` int(11) NOT NULL,
48 `quantity` int(11) DEFAULT NULL,
49 KEY `product_id` (`product_id`),
50 KEY `location_id` (`location_id`),
51 CONSTRAINT `product_locations_ibfk_1` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`),
52 CONSTRAINT `product_locations_ibfk_2` FOREIGN KEY (`location_id`) REFERENCES `locations` (`id`)
53) ENGINE=InnoDB DEFAULT CHARSET=latin1;
54
55-- Dumping data for table toolsforever.product_locations: ~3 rows (approximately)
56DELETE FROM `product_locations`;
57/*!40000 ALTER TABLE `product_locations` DISABLE KEYS */;
58/*!40000 ALTER TABLE `product_locations` ENABLE KEYS */;
59
60-- Dumping structure for table toolsforever.users
61CREATE TABLE IF NOT EXISTS `users` (
62 `id` int(11) NOT NULL AUTO_INCREMENT,
63 `username` varchar(50) DEFAULT NULL,
64 `password` varchar(50) DEFAULT NULL,
65 PRIMARY KEY (`id`)
66) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
67
68-- Dumping data for table toolsforever.users: ~1 rows (approximately)
69DELETE FROM `users`;
70/*!40000 ALTER TABLE `users` DISABLE KEYS */;
71INSERT INTO `users` (`id`, `username`, `password`) VALUES
72 (1, 'admin', '21232f297a57a5a743894a0e4a801fc3');
73/*!40000 ALTER TABLE `users` ENABLE KEYS */;
74
75-- Dumping structure for table toolsforever.factories
76CREATE TABLE IF NOT EXISTS `factories` (
77 `id` int(11) NOT NULL,
78 `name` varchar(50) NOT NULL,
79 `location` int(11) DEFAULT NULL,
80 KEY `location` (`location`),
81 CONSTRAINT `factories_ibfk_1` FOREIGN KEY (`location`) REFERENCES `locations` (`id`)
82) ENGINE=InnoDB DEFAULT CHARSET=latin1;
83
84-- Dumping data for table toolsforever.factories: ~3 rows (approximately)
85DELETE FROM `factories`;
86/*!40000 ALTER TABLE `factories` DISABLE KEYS */;
87/*!40000 ALTER TABLE `factories` ENABLE KEYS */;
88
89/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
90/*!40014 SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS IS NULL, 1, @OLD_FOREIGN_KEY_CHECKS) */;
91/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;