· 5 years ago · May 05, 2020, 07:14 PM
1-- phpMyAdmin SQL Dump
2-- version 5.0.2
3-- https://www.phpmyadmin.net/
4--
5-- Host: 127.0.0.1
6-- Generation Time: May 05, 2020 at 09:09 PM
7-- Server version: 10.4.11-MariaDB
8-- PHP Version: 7.4.5
9
10SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
11START TRANSACTION;
12SET time_zone = "+00:00";
13
14--
15-- Database: `place`
16--
17CREATE DATABASE IF NOT EXISTS `place` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
18USE `place`;
19
20-- --------------------------------------------------------
21
22--
23-- Table structure for table `place_history`
24--
25
26CREATE TABLE `place_history` (
27 `Id` int(11) NOT NULL,
28 `X` int(11) NOT NULL,
29 `Y` int(11) NOT NULL,
30 `Color` int(11) NOT NULL,
31 `UserId` text NOT NULL,
32 `Timestamp` timestamp NOT NULL DEFAULT current_timestamp()
33) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
34
35-- --------------------------------------------------------
36
37--
38-- Table structure for table `place_requests`
39--
40
41CREATE TABLE `place_requests` (
42 `Id` int(11) NOT NULL,
43 `RequestCode` text NOT NULL,
44 `UserId` text NOT NULL,
45 `LastUpdate` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
46) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
47
48-- --------------------------------------------------------
49
50--
51-- Table structure for table `place_tiles`
52--
53
54CREATE TABLE `place_tiles` (
55 `Id` int(11) NOT NULL,
56 `X` int(11) NOT NULL,
57 `Y` int(11) NOT NULL,
58 `Color` tinyint(4) NOT NULL,
59 `LastUserId` int(11) DEFAULT NULL,
60 `Timestamp` timestamp NOT NULL DEFAULT current_timestamp()
61) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
62
63-- --------------------------------------------------------
64
65--
66-- Table structure for table `place_timestamps`
67--
68
69CREATE TABLE `place_timestamps` (
70 `Id` int(11) NOT NULL,
71 `UserId` text NOT NULL,
72 `Timestamp` timestamp NOT NULL DEFAULT current_timestamp()
73) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
74
75--
76-- Indexes for dumped tables
77--
78
79--
80-- Indexes for table `place_history`
81--
82ALTER TABLE `place_history`
83 ADD PRIMARY KEY (`Id`);
84
85--
86-- Indexes for table `place_requests`
87--
88ALTER TABLE `place_requests`
89 ADD PRIMARY KEY (`Id`);
90
91--
92-- Indexes for table `place_tiles`
93--
94ALTER TABLE `place_tiles`
95 ADD PRIMARY KEY (`Id`),
96 ADD UNIQUE KEY `Place_Tiles_Unique` (`Y`,`X`),
97 ADD KEY `X` (`X`),
98 ADD KEY `Y` (`Y`);
99
100--
101-- Indexes for table `place_timestamps`
102--
103ALTER TABLE `place_timestamps`
104 ADD PRIMARY KEY (`Id`),
105 ADD UNIQUE KEY `Place_Timestamps_UNIQUE` (`UserId`) USING HASH,
106 ADD KEY `UserId` (`UserId`(768));
107
108--
109-- AUTO_INCREMENT for dumped tables
110--
111
112--
113-- AUTO_INCREMENT for table `place_history`
114--
115ALTER TABLE `place_history`
116 MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT;
117
118--
119-- AUTO_INCREMENT for table `place_requests`
120--
121ALTER TABLE `place_requests`
122 MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT;
123
124--
125-- AUTO_INCREMENT for table `place_tiles`
126--
127ALTER TABLE `place_tiles`
128 MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT;
129
130--
131-- AUTO_INCREMENT for table `place_timestamps`
132--
133ALTER TABLE `place_timestamps`
134 MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT;
135COMMIT;