· 6 years ago · Aug 07, 2019, 01:56 PM
1-- MySQL dump 10.13 Distrib 8.0.11, for Win64 (x86_64)
2--
3-- Host: localhost Database: schema1
4-- ------------------------------------------------------
5-- Server version 8.0.11
6
7/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
8/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
9/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
10 SET NAMES utf8mb4 ;
11/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
12/*!40103 SET TIME_ZONE='+00:00' */;
13/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
14/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
15/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
16/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
17
18--
19-- Table structure for table `stream`
20--
21
22DROP TABLE IF EXISTS `stream`;
23/*!40101 SET @saved_cs_client = @@character_set_client */;
24 SET character_set_client = utf8mb4 ;
25CREATE TABLE `stream` (
26 `stream_id` bigint(1) NOT NULL AUTO_INCREMENT,
27 `streamer_id` bigint(1) NOT NULL,
28 `begin` datetime NOT NULL,
29 `finish` datetime DEFAULT NULL,
30 PRIMARY KEY (`stream_id`),
31 KEY `fk_stream_streamer_id_idx` (`streamer_id`),
32 CONSTRAINT `fk_stream_streamer_id` FOREIGN KEY (`streamer_id`) REFERENCES `twitchuser` (`user_id`)
33) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
34/*!40101 SET character_set_client = @saved_cs_client */;
35
36--
37-- Dumping data for table `stream`
38--
39
40LOCK TABLES `stream` WRITE;
41/*!40000 ALTER TABLE `stream` DISABLE KEYS */;
42/*!40000 ALTER TABLE `stream` ENABLE KEYS */;
43UNLOCK TABLES;
44
45--
46-- Table structure for table `streamwatch`
47--
48
49DROP TABLE IF EXISTS `streamwatch`;
50/*!40101 SET @saved_cs_client = @@character_set_client */;
51 SET character_set_client = utf8mb4 ;
52CREATE TABLE `streamwatch` (
53 `streamwatch_id` bigint(1) NOT NULL AUTO_INCREMENT,
54 `watcher_id` bigint(1) NOT NULL,
55 `stream_id` bigint(1) NOT NULL,
56 `begin` datetime NOT NULL,
57 `finish` datetime DEFAULT NULL,
58 PRIMARY KEY (`streamwatch_id`),
59 KEY `fk_streamwatch_stream_id_idx` (`stream_id`),
60 KEY `fk_streamwatch_watcher_id_idx` (`watcher_id`),
61 CONSTRAINT `fk_streamwatch_stream_id` FOREIGN KEY (`stream_id`) REFERENCES `stream` (`stream_id`),
62 CONSTRAINT `fk_streamwatch_watcher_id` FOREIGN KEY (`watcher_id`) REFERENCES `twitchuser` (`user_id`)
63) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
64/*!40101 SET character_set_client = @saved_cs_client */;
65
66--
67-- Dumping data for table `streamwatch`
68--
69
70LOCK TABLES `streamwatch` WRITE;
71/*!40000 ALTER TABLE `streamwatch` DISABLE KEYS */;
72/*!40000 ALTER TABLE `streamwatch` ENABLE KEYS */;
73UNLOCK TABLES;
74
75--
76-- Table structure for table `twitchuser`
77--
78
79DROP TABLE IF EXISTS `twitchuser`;
80/*!40101 SET @saved_cs_client = @@character_set_client */;
81 SET character_set_client = utf8mb4 ;
82CREATE TABLE `twitchuser` (
83 `user_id` bigint(1) NOT NULL AUTO_INCREMENT,
84 `name` varchar(30) NOT NULL,
85 PRIMARY KEY (`user_id`)
86) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
87/*!40101 SET character_set_client = @saved_cs_client */;
88
89--
90-- Dumping data for table `twitchuser`
91--
92
93LOCK TABLES `twitchuser` WRITE;
94/*!40000 ALTER TABLE `twitchuser` DISABLE KEYS */;
95/*!40000 ALTER TABLE `twitchuser` ENABLE KEYS */;
96UNLOCK TABLES;
97/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
98
99/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
100/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
101/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
102/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
103/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
104/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
105/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
106
107-- Dump completed on 2018-04-22 15:11:32