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