-
Notifications
You must be signed in to change notification settings - Fork 1
/
chaty database.sql
46 lines (39 loc) · 1.67 KB
/
chaty database.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
Navicat Premium Data Transfer
Source Server : DS
Source Server Type : MySQL
Source Server Version : 100131
Source Host : localhost:3306
Source Schema : chaty
Target Server Type : MySQL
Target Server Version : 100131
File Encoding : 65001
Date: 28/04/2019 08:30:44
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for connections
-- ----------------------------
DROP TABLE IF EXISTS `connections`;
CREATE TABLE `connections` (
`room_id` int(11) NOT NULL,
`nick_name` varchar(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT 'user',
`ip` varchar(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
`last_time_entered` bigint(20) NOT NULL,
PRIMARY KEY (`room_id`, `nick_name`) USING BTREE,
UNIQUE INDEX `unique connection`(`room_id`, `nick_name`) USING BTREE,
CONSTRAINT `room_name` FOREIGN KEY (`room_id`) REFERENCES `rooms` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for rooms
-- ----------------------------
DROP TABLE IF EXISTS `rooms`;
CREATE TABLE `rooms` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`room_name` varchar(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
`password` varchar(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `roomNameandpassword`(`room_name`, `password`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 191 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Compact;
SET FOREIGN_KEY_CHECKS = 1;