· 9 years ago · Jan 02, 2017, 03:38 AM
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--
18CREATE DATABASE IF NOT EXISTS `altislife` DEFAULT CHARACTER SET utf8mb4;
19USE `altislife`;
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`;
29DROP PROCEDURE IF EXISTS `deleteOldWanted`;
30
31-- --------------------------------------------------------
32
33--
34-- Table structure for table `players`
35--
36
37CREATE TABLE IF NOT EXISTS `players` (
38 `uid` int(6) NOT NULL AUTO_INCREMENT,
39 `name` varchar(32) NOT NULL,
40 `aliases` text NOT NULL,
41 `pid` varchar(17) NOT NULL,
42 `cash` int(100) NOT NULL DEFAULT '0',
43 `bankacc` int(100) NOT NULL DEFAULT '0',
44 `coplevel` enum('0','1','2','3','4','5','6','7') NOT NULL DEFAULT '0',
45 `mediclevel` enum('0','1','2','3','4','5') NOT NULL DEFAULT '0',
46 `civ_licenses` text NOT NULL,
47 `cop_licenses` text NOT NULL,
48 `med_licenses` text NOT NULL,
49 `civ_gear` text NOT NULL,
50 `cop_gear` text NOT NULL,
51 `med_gear` text NOT NULL,
52 `civ_stats` varchar(32) NOT NULL DEFAULT '"[100,100,0]"',
53 `cop_stats` varchar(32) NOT NULL DEFAULT '"[100,100,0]"',
54 `med_stats` varchar(32) NOT NULL DEFAULT '"[100,100,0]"',
55 `arrested` tinyint(1) NOT NULL DEFAULT '0',
56 `adminlevel` enum('0','1','2','3','4','5') NOT NULL DEFAULT '0',
57 `donorlevel` enum('0','1','2','3','4','5') NOT NULL DEFAULT '0',
58 `blacklist` tinyint(1) NOT NULL DEFAULT '0',
59 `civ_alive` tinyint(1) NOT NULL DEFAULT '0',
60 `civ_position` varchar(64) NOT NULL DEFAULT '"[]"',
61 `playtime` varchar(32) NOT NULL DEFAULT '"[0,0,0]"',
62 `insert_time` timestamp DEFAULT CURRENT_TIMESTAMP,
63 `last_seen` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
64 PRIMARY KEY (`uid`),
65 UNIQUE KEY `pid` (`pid`),
66 KEY `name` (`name`),
67 KEY `blacklist` (`blacklist`)
68) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=12 ;
69
70-- --------------------------------------------------------
71
72--
73-- Table structure for table `vehicles`
74--
75
76CREATE TABLE IF NOT EXISTS `vehicles` (
77 `id` int(6) NOT NULL AUTO_INCREMENT,
78 `side` varchar(16) NOT NULL,
79 `classname` varchar(64) NOT NULL,
80 `type` varchar(16) NOT NULL,
81 `pid` varchar(17) NOT NULL,
82 `alive` tinyint(1) NOT NULL DEFAULT '1',
83 `blacklist` tinyint(1) NOT NULL DEFAULT '0',
84 `active` tinyint(1) NOT NULL DEFAULT '0',
85 `plate` int(20) NOT NULL,
86 `color` int(20) NOT NULL,
87 `inventory` text NOT NULL,
88 `gear` text NOT NULL,
89 `fuel` double NOT NULL DEFAULT '1',
90 `damage` varchar(256) NOT NULL,
91 `insert_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
92 PRIMARY KEY (`id`),
93 KEY `side` (`side`),
94 KEY `pid` (`pid`),
95 KEY `type` (`type`)
96) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=2 ;
97
98-- --------------------------------------------------------
99
100--
101-- Table structure for table `houses`
102-- Needed for extDB latest update on git
103--
104
105CREATE TABLE IF NOT EXISTS `houses` (
106 `id` int(6) NOT NULL AUTO_INCREMENT,
107 `pid` varchar(17) NOT NULL,
108 `pos` varchar(64) DEFAULT NULL,
109 `owned` tinyint(1) DEFAULT '0',
110 `garage` tinyint(1) NOT NULL DEFAULT '0',
111 `insert_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
112 PRIMARY KEY (`id`,`pid`)
113) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=4 ;
114
115-- --------------------------------------------------------
116
117--
118-- Table structure for table `gangs`
119-- Needed for extDB latest update on git
120--
121
122CREATE TABLE IF NOT EXISTS `gangs` (
123 `id` int(6) NOT NULL AUTO_INCREMENT,
124 `owner` varchar(32) DEFAULT NULL,
125 `name` varchar(32) DEFAULT NULL,
126 `members` text,
127 `maxmembers` int(3) DEFAULT '8',
128 `bank` int(100) DEFAULT '0',
129 `active` tinyint(1) DEFAULT '1',
130 `insert_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
131 PRIMARY KEY (`id`),
132 UNIQUE KEY `name_UNIQUE` (`name`)
133) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
134
135-- --------------------------------------------------------
136
137--
138-- Table structure for table `containers`
139-- Needed for extDB latest update on git
140--
141
142CREATE TABLE IF NOT EXISTS `containers` (
143 `id` int(6) NOT NULL AUTO_INCREMENT,
144 `pid` varchar(17) NOT NULL,
145 `classname` varchar(32) NOT NULL,
146 `pos` varchar(64) DEFAULT NULL,
147 `inventory` text NOT NULL,
148 `gear` text NOT NULL,
149 `dir` varchar(128) DEFAULT NULL,
150 `active` tinyint(1) NOT NULL DEFAULT '0',
151 `owned` tinyint(1) DEFAULT '0',
152 `insert_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
153 PRIMARY KEY (`id`,`pid`)
154) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=4;
155
156-- --------------------------------------------------------
157
158--
159-- Table structure for table `wanted`
160-- Needed for extDB latest update on git
161--
162
163CREATE TABLE IF NOT EXISTS `wanted` (
164 `wantedID` varchar(64) NOT NULL,
165 `wantedName` varchar(32) NOT NULL,
166 `wantedCrimes` text NOT NULL,
167 `wantedBounty` int(100) NOT NULL,
168 `active` tinyint(1) NOT NULL DEFAULT '0',
169 `insert_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
170 PRIMARY KEY (`wantedID`)
171) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
172
173-- --------------------------------------------------------
174
175/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
176/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
177/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;