· 6 years ago · Jul 18, 2019, 09:40 PM
1SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
2SET time_zone = "+00:00";
3--
4-- Compatible with newer MySQL versions. (After MySQL-5.5)
5-- This SQL uses utf8mb4 and has CURRENT_TIMESTAMP function.
6--
7
8
9/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
10/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
11/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
12/*!40101 SET NAMES utf8mb4 */;
13
14--
15-- Database: `db1162`
16-- Default Schema
17-- CREATE DATABASE IF NOT EXISTS `db1162` DEFAULT CHARACTER SET utf8mb4;
18--
19USE `db1162`;
20
21--
22-- Drop procedures to ensure no conflicts
23--
24DROP PROCEDURE IF EXISTS `resetLifeVehicles`;
25DROP PROCEDURE IF EXISTS `deleteDeadVehicles`;
26DROP PROCEDURE IF EXISTS `deleteOldHouses`;
27DROP PROCEDURE IF EXISTS `deleteOldGangs`;
28DROP PROCEDURE IF EXISTS `deleteOldContainers`;
29
30DELIMITER $$
31--
32-- Procedures
33--
34
35CREATE DEFINER=`db1162`@`209.222.101.53` PROCEDURE `resetLifeVehicles`()
36BEGIN
37 UPDATE `vehicles` SET `active`= 0;
38END$$
39
40CREATE DEFINER=`db1162`@`209.222.101.53` PROCEDURE `deleteDeadVehicles`()
41BEGIN
42 DELETE FROM `vehicles` WHERE `alive` = 0;
43END$$
44
45CREATE DEFINER=`db1162`@`209.222.101.53` PROCEDURE `deleteOldHouses`()
46BEGIN
47 DELETE FROM `houses` WHERE `owned` = 0;
48END$$
49
50CREATE DEFINER=`db1162`@`209.222.101.53` PROCEDURE `deleteOldGangs`()
51BEGIN
52 DELETE FROM `gangs` WHERE `active` = 0;
53END$$
54
55CREATE DEFINER=`db1162`@`209.222.101.53` PROCEDURE `deleteOldContainers`()
56BEGIN
57 DELETE FROM `containers` WHERE `owned` = 0;
58END$$
59
60DELIMITER ;
61
62-- --------------------------------------------------------
63
64--
65-- Table structure for table `players`
66--
67
68CREATE TABLE IF NOT EXISTS `players` (
69 `uid` int(12) NOT NULL AUTO_INCREMENT,
70 `name` varchar(32) NOT NULL,
71 `aliases` text NOT NULL,
72 `playerid` varchar(64) NOT NULL,
73 `cash` int(100) NOT NULL DEFAULT '0',
74 `bankacc` int(100) NOT NULL DEFAULT '0',
75 `coplevel` enum('0','1','2','3','4','5','6','7') NOT NULL DEFAULT '0',
76 `mediclevel` enum('0','1','2','3','4','5') NOT NULL DEFAULT '0',
77 `civ_licenses` text NOT NULL,
78 `cop_licenses` text NOT NULL,
79 `med_licenses` text NOT NULL,
80 `civ_gear` text NOT NULL,
81 `cop_gear` text NOT NULL,
82 `med_gear` text NOT NULL,
83 `civ_stats` varchar(32) NOT NULL DEFAULT '"[100,100,0]"',
84 `cop_stats` varchar(32) NOT NULL DEFAULT '"[100,100,0]"',
85 `med_stats` varchar(32) NOT NULL DEFAULT '"[100,100,0]"',
86 `arrested` tinyint(1) NOT NULL DEFAULT '0',
87 `adminlevel` enum('0','1','2','3','4','5') NOT NULL DEFAULT '0',
88 `donorlevel` enum('0','1','2','3','4','5') NOT NULL DEFAULT '0',
89 `blacklist` tinyint(1) NOT NULL DEFAULT '0',
90 `civ_alive` tinyint(1) NOT NULL DEFAULT '0',
91 `civ_position` varchar(64) NOT NULL DEFAULT '"[]"',
92 `playtime` varchar(32) NOT NULL DEFAULT '"[0,0,0]"',
93 `insert_time` timestamp DEFAULT CURRENT_TIMESTAMP,
94 `last_seen` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
95 PRIMARY KEY (`uid`),
96 UNIQUE KEY `playerid` (`playerid`),
97 KEY `name` (`name`),
98 KEY `blacklist` (`blacklist`)
99) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=12 ;
100
101-- --------------------------------------------------------
102
103--
104-- Table structure for table `vehicles`
105--
106
107CREATE TABLE IF NOT EXISTS `vehicles` (
108 `id` int(12) NOT NULL AUTO_INCREMENT,
109 `side` varchar(16) NOT NULL,
110 `classname` varchar(64) NOT NULL,
111 `type` varchar(16) NOT NULL,
112 `pid` varchar(32) NOT NULL,
113 `alive` tinyint(1) NOT NULL DEFAULT '1',
114 `blacklist` tinyint(1) NOT NULL DEFAULT '0',
115 `active` tinyint(1) NOT NULL DEFAULT '0',
116 `plate` int(20) NOT NULL,
117 `color` int(20) NOT NULL,
118 `inventory` text NOT NULL,
119 `gear` text NOT NULL,
120 `fuel` double NOT NULL DEFAULT '1',
121 `damage` varchar(256) NOT NULL,
122 `insert_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
123 PRIMARY KEY (`id`),
124 KEY `side` (`side`),
125 KEY `pid` (`pid`),
126 KEY `type` (`type`)
127) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=2 ;
128
129-- --------------------------------------------------------
130
131--
132-- Table structure for table `houses`
133-- Needed for extDB latest update on git
134--
135
136CREATE TABLE IF NOT EXISTS `houses` (
137 `id` int(11) NOT NULL AUTO_INCREMENT,
138 `pid` varchar(32) NOT NULL,
139 `pos` varchar(64) DEFAULT NULL,
140 `owned` tinyint(1) DEFAULT '0',
141 `insert_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
142 PRIMARY KEY (`id`,`pid`)
143) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=4 ;
144
145-- --------------------------------------------------------
146
147--
148-- Table structure for table `gangs`
149-- Needed for extDB latest update on git
150--
151
152CREATE TABLE IF NOT EXISTS `gangs` (
153 `id` int(11) NOT NULL AUTO_INCREMENT,
154 `owner` varchar(32) DEFAULT NULL,
155 `name` varchar(32) DEFAULT NULL,
156 `members` text,
157 `maxmembers` int(3) DEFAULT '8',
158 `bank` int(100) DEFAULT '0',
159 `active` tinyint(1) DEFAULT '1',
160 `insert_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
161 PRIMARY KEY (`id`),
162 UNIQUE KEY `name_UNIQUE` (`name`)
163) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
164
165-- --------------------------------------------------------
166
167--
168-- Table structure for table `containers`
169-- Needed for extDB latest update on git
170--
171
172CREATE TABLE IF NOT EXISTS `containers` (
173 `id` int(11) NOT NULL AUTO_INCREMENT,
174 `pid` varchar(32) NOT NULL,
175 `classname` varchar(32) NOT NULL,
176 `pos` varchar(64) DEFAULT NULL,
177 `inventory` text NOT NULL,
178 `gear` text NOT NULL,
179 `dir` varchar(128) DEFAULT NULL,
180 `active` tinyint(1) NOT NULL DEFAULT '0',
181 `owned` tinyint(1) DEFAULT '0',
182 `insert_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
183 PRIMARY KEY (`id`,`pid`)
184) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=4;
185
186-- --------------------------------------------------------
187
188--
189-- Table structure for table `wanted`
190-- Needed for extDB latest update on git
191--
192
193CREATE TABLE IF NOT EXISTS `wanted` (
194 `wantedID` varchar(64) NOT NULL,
195 `wantedName` varchar(32) NOT NULL,
196 `wantedCrimes` text NOT NULL,
197 `wantedBounty` int(100) NOT NULL,
198 `active` tinyint(1) NOT NULL DEFAULT '0',
199 `insert_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
200 PRIMARY KEY (`wantedID`)
201) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
202
203-- --------------------------------------------------------
204
205/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
206/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
207/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;