· 8 years ago · Dec 16, 2017, 07:26 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: `daf_rpcoop`
16-- Default Schema
17--
18CREATE DATABASE IF NOT EXISTS `daf_rpcoop` DEFAULT CHARACTER SET utf8mb4;
19USE `daf_rpcoop`;
20
21--
22-- Drop procedures to ensure no conflicts
23--
24DROP PROCEDURE IF EXISTS `resetLifeVehicles`;
25DROP PROCEDURE IF EXISTS `deleteDeadVehicles`;
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=`Utilisateur`@`localhost` PROCEDURE `resetLifeVehicles`()
36BEGIN
37 UPDATE `vehicles` SET `active`= 0;
38END$$
39
40CREATE DEFINER=`Utilisateur`@`localhost` PROCEDURE `deleteDeadVehicles`()
41BEGIN
42 DELETE FROM `vehicles` WHERE `alive` = 0;
43END$$
44
45
46CREATE DEFINER=`Utilisateur`@`localhost` PROCEDURE `deleteOldContainers`()
47BEGIN
48 DELETE FROM `containers` WHERE `owned` = 0;
49END$$
50
51DELIMITER ;
52
53-- --------------------------------------------------------
54
55--
56-- Table structure for table `players`
57--
58
59CREATE TABLE IF NOT EXISTS `players` (
60 `uid` int(6) NOT NULL AUTO_INCREMENT,
61 `name` varchar(32) NOT NULL,
62 `aliases` text NOT NULL,
63 `pid` varchar(17) NOT NULL,
64 `cash` int(100) NOT NULL DEFAULT '0',
65 `bankacc` int(100) NOT NULL DEFAULT '0',
66 `hierarchie` enum('0','1','2','3','4','5','6','7') NOT NULL DEFAULT '0',
67 `xplevel` enum('0','1','2','3','4','5','6','7','8','9','10') NOT NULL DEFAULT '0',
68 `spec` text NOT NULL,
69 `inv_virt` text NOT NULL,
70 `inv_unit` text NOT NULL,
71 `stats` varchar(32) NOT NULL DEFAULT '"[100,100,0]"',
72 `adminlevel` enum('0','1','2','3','4','5') NOT NULL DEFAULT '0',
73 `vip` enum('0','1','2','3','4','5') NOT NULL DEFAULT '0',
74 `blacklist` tinyint(1) NOT NULL DEFAULT '0',
75 `save_pos` varchar(64) NOT NULL DEFAULT '"[]"',
76 `playtime` varchar(32) NOT NULL DEFAULT '"[0,0,0]"',
77 `insert_time` timestamp DEFAULT CURRENT_TIMESTAMP,
78 `last_seen` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
79 PRIMARY KEY (`uid`),
80 UNIQUE KEY `pid` (`pid`),
81 KEY `name` (`name`),
82 KEY `blacklist` (`blacklist`)
83) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=12 ;
84
85-- --------------------------------------------------------
86
87--
88-- Table structure for table `vehicles`
89--
90
91CREATE TABLE IF NOT EXISTS `vehicles` (
92 `id` int(6) NOT NULL AUTO_INCREMENT,
93 `side` varchar(16) NOT NULL,
94 `classname` varchar(64) NOT NULL,
95 `type` varchar(16) NOT NULL,
96 `pid` varchar(17) NOT NULL,
97 `alive` tinyint(1) NOT NULL DEFAULT '1',
98 `active` tinyint(1) NOT NULL DEFAULT '0',
99 `plak` text NOT NULL,
100 `color` int(20) NOT NULL,
101 `inventory` text NOT NULL,
102 `gear` text NOT NULL,
103 `fuel` double NOT NULL DEFAULT '1',
104 `damage` varchar(256) NOT NULL,
105 `insert_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
106 PRIMARY KEY (`id`),
107 KEY `side` (`side`),
108 KEY `pid` (`pid`),
109 KEY `type` (`type`)
110) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=2 ;
111
112-- --------------------------------------------------------
113
114--
115-- Table structure for table `containers`
116-- Needed for extDB latest update on git
117--
118
119CREATE TABLE IF NOT EXISTS `containers` (
120 `id` int(6) NOT NULL AUTO_INCREMENT,
121 `pid` varchar(17) NOT NULL,
122 `classname` varchar(32) NOT NULL,
123 `pos` varchar(64) DEFAULT NULL,
124 `inventory` text NOT NULL,
125 `gear` text NOT NULL,
126 `dir` varchar(128) DEFAULT NULL,
127 `active` tinyint(1) NOT NULL DEFAULT '0',
128 `owned` tinyint(1) DEFAULT '0',
129 `insert_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
130 PRIMARY KEY (`id`,`pid`)
131) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=4;
132
133-- --------------------------------------------------------
134/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
135/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
136/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;