· 9 years ago · Oct 28, 2016, 12:56 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`;
27
28DELIMITER $$
29--
30-- Procedures
31-- Edit arma3 to match a user in MySQL
32-- For external databases: Edit localhost to match arma3server IP
33--
34
35CREATE DEFINER=`phasehos_altislife`@`151.80.47.34` PROCEDURE `resetLifeVehicles`()
36BEGIN
37 UPDATE `vehicles` SET `active`= 0;
38END$$
39
40CREATE DEFINER=`phasehos_altislife`@`151.80.47.34` PROCEDURE `deleteDeadVehicles`()
41BEGIN
42 DELETE FROM `vehicles` WHERE `alive` = 0;
43END$$
44
45CREATE DEFINER=`phasehos_altislife`@`151.80.47.34` PROCEDURE `deleteOldHouses`()
46BEGIN
47 DELETE FROM `houses` WHERE `owned` = 0;
48END$$
49
50CREATE DEFINER=`phasehos_altislife`@`151.80.47.34` PROCEDURE `deleteOldGangs`()
51BEGIN
52 DELETE FROM `gangs` WHERE `active` = 0;
53END$$
54
55CREATE DEFINER=`phasehos_altislife`@`151.80.47.34` 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(6) NOT NULL AUTO_INCREMENT,
70 `name` varchar(32) NOT NULL,
71 `aliases` text NOT NULL,
72 `pid` varchar(17) 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 `pid` (`pid`),
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(6) 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(17) 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(6) NOT NULL AUTO_INCREMENT,
138 `pid` varchar(17) NOT NULL,
139 `pos` varchar(64) DEFAULT NULL,
140 `owned` tinyint(1) DEFAULT '0',
141 `garage` tinyint(1) NOT NULL DEFAULT '0',
142 `insert_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
143 PRIMARY KEY (`id`,`pid`)
144) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=4 ;
145
146-- --------------------------------------------------------
147
148--
149-- Table structure for table `gangs`
150-- Needed for extDB latest update on git
151--
152
153CREATE TABLE IF NOT EXISTS `gangs` (
154 `id` int(6) NOT NULL AUTO_INCREMENT,
155 `owner` varchar(32) DEFAULT NULL,
156 `name` varchar(32) DEFAULT NULL,
157 `members` text,
158 `maxmembers` int(3) DEFAULT '8',
159 `bank` int(100) DEFAULT '0',
160 `active` tinyint(1) DEFAULT '1',
161 `insert_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
162 PRIMARY KEY (`id`),
163 UNIQUE KEY `name_UNIQUE` (`name`)
164) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
165
166-- --------------------------------------------------------
167
168--
169-- Table structure for table `containers`
170-- Needed for extDB latest update on git
171--
172
173CREATE TABLE IF NOT EXISTS `containers` (
174 `id` int(6) NOT NULL AUTO_INCREMENT,
175 `pid` varchar(17) NOT NULL,
176 `classname` varchar(32) NOT NULL,
177 `pos` varchar(64) DEFAULT NULL,
178 `inventory` text NOT NULL,
179 `gear` text NOT NULL,
180 `dir` varchar(128) DEFAULT NULL,
181 `active` tinyint(1) NOT NULL DEFAULT '0',
182 `owned` tinyint(1) DEFAULT '0',
183 `insert_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
184 PRIMARY KEY (`id`,`pid`)
185) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=4;
186
187-- --------------------------------------------------------
188
189--
190-- Table structure for table `wanted`
191-- Needed for extDB latest update on git
192--
193
194CREATE TABLE IF NOT EXISTS `wanted` (
195 `wantedID` varchar(64) NOT NULL,
196 `wantedName` varchar(32) NOT NULL,
197 `wantedCrimes` text NOT NULL,
198 `wantedBounty` int(100) NOT NULL,
199 `active` tinyint(1) NOT NULL DEFAULT '0',
200 `insert_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
201 PRIMARY KEY (`wantedID`)
202) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
203
204-- --------------------------------------------------------
205
206CREATE TABLE `dynmarket` (
207 `id` INT NOT NULL DEFAULT 1,
208 `prices` TEXT NOT NULL,
209 PRIMARY KEY (`id`));
210
211INSERT INTO `dynmarket` VALUES (1,'[]');
212
213-- --------------------------------------------------------
214
215/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
216/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
217/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;