Advertisement
Guest User

Untitled

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