· 6 years ago · Apr 27, 2019, 02:08 PM
1/*
2Navicat MySQL Data Transfer
3
4Source Server : altislife
5Source Server Version : 50718
6Source Host : localhost:3306
7Source Database : altislife
8
9Target Server Type : MYSQL
10Target Server Version : 50718
11File Encoding : 65001
12
13Date: 2017-07-21 23:44:12
14*/
15
16SET FOREIGN_KEY_CHECKS=0;
17
18CREATE DATABASE IF NOT EXISTS `altislife` DEFAULT CHARACTER SET utf8mb4;
19USE `altislife`;
20
21CREATE USER IF NOT EXISTS `arma3`@`localhost` IDENTIFIED BY 'thomas';
22
23GRANT SELECT,UPDATE,INSERT,DELETE ON `altislife`.* TO 'arma3'@'localhost';
24GRANT EXECUTE ON altislife.* TO 'arma3'@'localhost';
25
26-- ----------------------------
27-- Table structure for `containers`
28-- ----------------------------
29DROP TABLE IF EXISTS `containers`;
30CREATE TABLE `containers` (
31 `id` int(6) NOT NULL AUTO_INCREMENT,
32 `pid` varchar(17) NOT NULL,
33 `classname` varchar(32) NOT NULL,
34 `pos` varchar(64) DEFAULT NULL,
35 `inventory` text NOT NULL,
36 `gear` text NOT NULL,
37 `dir` varchar(128) DEFAULT NULL,
38 `active` tinyint(1) NOT NULL DEFAULT '0',
39 `owned` tinyint(1) DEFAULT '0',
40 `insert_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
41 PRIMARY KEY (`id`,`pid`)
42) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
43
44-- ----------------------------
45-- Records of containers
46-- ----------------------------
47
48-- ----------------------------
49-- Table structure for `gangs`
50-- ----------------------------
51DROP TABLE IF EXISTS `gangs`;
52CREATE TABLE `gangs` (
53 `id` int(6) NOT NULL AUTO_INCREMENT,
54 `owner` varchar(32) DEFAULT NULL,
55 `name` varchar(32) DEFAULT NULL,
56 `members` text,
57 `maxmembers` int(3) DEFAULT '8',
58 `bank` int(100) DEFAULT '0',
59 `active` tinyint(1) DEFAULT '1',
60 `insert_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
61 PRIMARY KEY (`id`),
62 UNIQUE KEY `name_UNIQUE` (`name`)
63) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
64
65-- ----------------------------
66-- Records of gangs
67-- ----------------------------
68
69-- ----------------------------
70-- Table structure for `houses`
71-- ----------------------------
72DROP TABLE IF EXISTS `houses`;
73CREATE TABLE `houses` (
74 `id` int(6) NOT NULL AUTO_INCREMENT,
75 `pid` varchar(17) NOT NULL,
76 `pos` varchar(64) DEFAULT NULL,
77 `owned` tinyint(1) DEFAULT '0',
78 `garage` tinyint(1) NOT NULL DEFAULT '0',
79 `insert_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
80 PRIMARY KEY (`id`,`pid`)
81) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
82
83-- ----------------------------
84-- Records of houses
85-- ----------------------------
86
87-- ----------------------------
88-- Table structure for `messages`
89-- ----------------------------
90DROP TABLE IF EXISTS `messages`;
91CREATE TABLE `messages` (
92 `uid` int(12) NOT NULL AUTO_INCREMENT,
93 `fromID` varchar(50) NOT NULL,
94 `toID` varchar(50) NOT NULL,
95 `message` text,
96 `fromName` varchar(32) NOT NULL,
97 `toName` varchar(32) NOT NULL,
98 `time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
99 PRIMARY KEY (`uid`)
100) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=latin1;
101
102-- ----------------------------
103-- Records of messages
104-- ----------------------------
105
106-- ----------------------------
107-- Table structure for `players`
108-- ----------------------------
109DROP TABLE IF EXISTS `players`;
110CREATE TABLE `players` (
111 `uid` int(6) NOT NULL AUTO_INCREMENT,
112 `name` varchar(32) NOT NULL,
113 `aliases` text NOT NULL,
114 `pid` varchar(17) NOT NULL,
115 `cash` int(100) NOT NULL DEFAULT '0',
116 `bankacc` int(100) NOT NULL DEFAULT '0',
117 `coplevel` enum('0','1','2','3','4','5','6','7') NOT NULL DEFAULT '0',
118 `mediclevel` enum('0','1','2','3','4','5') NOT NULL DEFAULT '0',
119 `civ_licenses` text NOT NULL,
120 `cop_licenses` text NOT NULL,
121 `med_licenses` text NOT NULL,
122 `civ_gear` text NOT NULL,
123 `cop_gear` text NOT NULL,
124 `med_gear` text NOT NULL,
125 `civ_stats` varchar(32) NOT NULL DEFAULT '"[100,100,0]"',
126 `cop_stats` varchar(32) NOT NULL DEFAULT '"[100,100,0]"',
127 `med_stats` varchar(32) NOT NULL DEFAULT '"[100,100,0]"',
128 `arrested` tinyint(1) NOT NULL DEFAULT '0',
129 `adminlevel` enum('0','1','2','3','4','5') NOT NULL DEFAULT '0',
130 `donorlevel` enum('0','1','2','3','4','5') NOT NULL DEFAULT '0',
131 `blacklist` tinyint(1) NOT NULL DEFAULT '0',
132 `civ_alive` tinyint(1) NOT NULL DEFAULT '0',
133 `civ_position` varchar(64) NOT NULL DEFAULT '"[]"',
134 `playtime` varchar(32) NOT NULL DEFAULT '"[0,0,0]"',
135 `insert_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
136 `last_seen` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
137 PRIMARY KEY (`uid`),
138 UNIQUE KEY `pid` (`pid`),
139 KEY `name` (`name`),
140 KEY `blacklist` (`blacklist`)
141) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4;
142
143-- ----------------------------
144-- Table structure for `vehicles`
145-- ----------------------------
146DROP TABLE IF EXISTS `vehicles`;
147CREATE TABLE `vehicles` (
148 `id` int(6) NOT NULL AUTO_INCREMENT,
149 `side` varchar(16) NOT NULL,
150 `classname` varchar(64) NOT NULL,
151 `type` varchar(16) NOT NULL,
152 `pid` varchar(17) NOT NULL,
153 `alive` tinyint(1) NOT NULL DEFAULT '1',
154 `blacklist` tinyint(1) NOT NULL DEFAULT '0',
155 `active` tinyint(1) NOT NULL DEFAULT '0',
156 `plate` int(20) NOT NULL,
157 `color` int(20) NOT NULL,
158 `inventory` text NOT NULL,
159 `gear` text NOT NULL,
160 `fuel` double NOT NULL DEFAULT '1',
161 `damage` varchar(256) NOT NULL,
162 `insert_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
163 PRIMARY KEY (`id`),
164 KEY `side` (`side`),
165 KEY `pid` (`pid`),
166 KEY `type` (`type`)
167) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8mb4;
168
169-- ----------------------------
170-- Table structure for `wanted`
171-- ----------------------------
172DROP TABLE IF EXISTS `wanted`;
173CREATE TABLE `wanted` (
174 `wantedID` varchar(64) NOT NULL,
175 `wantedName` varchar(32) NOT NULL,
176 `wantedCrimes` text NOT NULL,
177 `wantedBounty` int(100) NOT NULL,
178 `active` tinyint(1) NOT NULL DEFAULT '0',
179 `insert_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
180 PRIMARY KEY (`wantedID`)
181) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
182
183-- ----------------------------
184-- Records of wanted
185-- ----------------------------
186
187-- ----------------------------
188-- Procedure structure for `deleteDeadVehicles`
189-- ----------------------------
190DROP PROCEDURE IF EXISTS `deleteDeadVehicles`;
191DELIMITER ;;
192CREATE DEFINER=`arma3`@`localhost` PROCEDURE `deleteDeadVehicles`()
193BEGIN
194 DELETE FROM `vehicles` WHERE `alive` = 0;
195END
196;;
197DELIMITER ;
198
199-- ----------------------------
200-- Procedure structure for `deleteOldContainers`
201-- ----------------------------
202DROP PROCEDURE IF EXISTS `deleteOldContainers`;
203DELIMITER ;;
204CREATE DEFINER=`arma3`@`localhost` PROCEDURE `deleteOldContainers`()
205BEGIN
206 DELETE FROM `containers` WHERE `owned` = 0;
207END
208;;
209DELIMITER ;
210
211-- ----------------------------
212-- Procedure structure for `deleteOldGangs`
213-- ----------------------------
214DROP PROCEDURE IF EXISTS `deleteOldGangs`;
215DELIMITER ;;
216CREATE DEFINER=`arma3`@`localhost` PROCEDURE `deleteOldGangs`()
217BEGIN
218 DELETE FROM `gangs` WHERE `active` = 0;
219END
220;;
221DELIMITER ;
222
223-- ----------------------------
224-- Procedure structure for `deleteOldHouses`
225-- ----------------------------
226DROP PROCEDURE IF EXISTS `deleteOldHouses`;
227DELIMITER ;;
228CREATE DEFINER=`arma3`@`localhost` PROCEDURE `deleteOldHouses`()
229BEGIN
230 DELETE FROM `houses` WHERE `owned` = 0;
231END
232;;
233DELIMITER ;
234
235-- ----------------------------
236-- Procedure structure for `deleteOldWanted`
237-- ----------------------------
238DROP PROCEDURE IF EXISTS `deleteOldWanted`;
239DELIMITER ;;
240CREATE DEFINER=`arma3`@`localhost` PROCEDURE `deleteOldWanted`()
241BEGIN
242 DELETE FROM `wanted` WHERE `active` = 0;
243END
244;;
245DELIMITER ;
246
247-- ----------------------------
248-- Procedure structure for `resetLifeVehicles`
249-- ----------------------------
250DROP PROCEDURE IF EXISTS `resetLifeVehicles`;
251DELIMITER ;;
252CREATE DEFINER=`arma3`@`localhost` PROCEDURE `resetLifeVehicles`()
253BEGIN
254 UPDATE `vehicles` SET `active`= 0;
255END
256;;
257DELIMITER ;