Advertisement
Guest User

Untitled

a guest
Jul 2nd, 2015
307
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 36.27 KB | None | 0 0
  1. -- phpMyAdmin SQL Dump
  2. -- version 3.2.4
  3. -- http://www.phpmyadmin.net
  4. --
  5. -- Servidor: localhost
  6. -- Tempo de Geração: Jul 02, 2015 as 09:41
  7. -- Versão do Servidor: 5.1.41
  8. -- Versão do PHP: 5.3.1
  9.  
  10. SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
  11.  
  12.  
  13. /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
  14. /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
  15. /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
  16. /*!40101 SET NAMES utf8 */;
  17.  
  18. --
  19. -- Banco de Dados: `tfs`
  20. --
  21.  
  22. -- --------------------------------------------------------
  23.  
  24. --
  25. -- Estrutura da tabela `accounts`
  26. --
  27.  
  28. CREATE TABLE IF NOT EXISTS `accounts` (
  29. `id` int(11) NOT NULL AUTO_INCREMENT,
  30. `name` varchar(32) NOT NULL,
  31. `password` char(40) NOT NULL,
  32. `type` int(11) NOT NULL DEFAULT '1',
  33. `premdays` int(11) NOT NULL DEFAULT '0',
  34. `lastday` int(10) unsigned NOT NULL DEFAULT '0',
  35. `email` varchar(255) NOT NULL DEFAULT '',
  36. `creation` int(11) NOT NULL DEFAULT '0',
  37. `page_access` int(11) DEFAULT NULL,
  38. `page_lastday` int(11) DEFAULT NULL,
  39. `email_new` varchar(255) DEFAULT NULL,
  40. `email_new_time` int(15) DEFAULT NULL,
  41. `rlname` varchar(255) DEFAULT NULL,
  42. `location` varchar(255) DEFAULT NULL,
  43. `created` int(16) DEFAULT NULL,
  44. `email_code` varchar(255) DEFAULT NULL,
  45. `next_email` int(11) DEFAULT NULL,
  46. `premium_points` int(11) DEFAULT NULL,
  47. `nickname` char(48) DEFAULT NULL,
  48. `avatar` char(48) DEFAULT NULL,
  49. `about_me` text,
  50. `key` varchar(128) NOT NULL DEFAULT '',
  51. `blocked` int(11) NOT NULL,
  52. PRIMARY KEY (`id`),
  53. UNIQUE KEY `name` (`name`)
  54. ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
  55.  
  56. --
  57. -- Extraindo dados da tabela `accounts`
  58. --
  59.  
  60. -- --------------------------------------------------------
  61.  
  62. --
  63. -- Estrutura da tabela `account_bans`
  64. --
  65.  
  66. CREATE TABLE IF NOT EXISTS `account_bans` (
  67. `account_id` int(11) NOT NULL,
  68. `reason` varchar(255) NOT NULL,
  69. `banned_at` bigint(20) NOT NULL,
  70. `expires_at` bigint(20) NOT NULL,
  71. `banned_by` int(11) NOT NULL,
  72. PRIMARY KEY (`account_id`),
  73. KEY `banned_by` (`banned_by`)
  74. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  75.  
  76. --
  77. -- Extraindo dados da tabela `account_bans`
  78. --
  79.  
  80.  
  81. -- --------------------------------------------------------
  82.  
  83. --
  84. -- Estrutura da tabela `account_ban_history`
  85. --
  86.  
  87. CREATE TABLE IF NOT EXISTS `account_ban_history` (
  88. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  89. `account_id` int(11) NOT NULL,
  90. `reason` varchar(255) NOT NULL,
  91. `banned_at` bigint(20) NOT NULL,
  92. `expired_at` bigint(20) NOT NULL,
  93. `banned_by` int(11) NOT NULL,
  94. PRIMARY KEY (`id`),
  95. KEY `account_id` (`account_id`),
  96. KEY `banned_by` (`banned_by`)
  97. ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  98.  
  99. --
  100. -- Extraindo dados da tabela `account_ban_history`
  101. --
  102.  
  103.  
  104. -- --------------------------------------------------------
  105.  
  106. --
  107. -- Estrutura da tabela `account_viplist`
  108. --
  109.  
  110. CREATE TABLE IF NOT EXISTS `account_viplist` (
  111. `account_id` int(11) NOT NULL COMMENT 'id of account whose viplist entry it is',
  112. `player_id` int(11) NOT NULL COMMENT 'id of target player of viplist entry',
  113. `description` varchar(128) NOT NULL DEFAULT '',
  114. `icon` tinyint(2) unsigned NOT NULL DEFAULT '0',
  115. `notify` tinyint(1) NOT NULL DEFAULT '0',
  116. UNIQUE KEY `account_player_index` (`account_id`,`player_id`),
  117. KEY `player_id` (`player_id`)
  118. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  119.  
  120. --
  121. -- Extraindo dados da tabela `account_viplist`
  122. --
  123.  
  124.  
  125. -- --------------------------------------------------------
  126.  
  127. --
  128. -- Estrutura da tabela `bans`
  129. --
  130.  
  131. CREATE TABLE IF NOT EXISTS `bans` (
  132. `id` int(11) NOT NULL,
  133. PRIMARY KEY (`id`)
  134. ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
  135.  
  136. --
  137. -- Extraindo dados da tabela `bans`
  138. --
  139.  
  140.  
  141. -- --------------------------------------------------------
  142.  
  143. --
  144. -- Estrutura da tabela `bugtracker`
  145. --
  146.  
  147. CREATE TABLE IF NOT EXISTS `bugtracker` (
  148. `id` int(11) NOT NULL AUTO_INCREMENT,
  149. `category` int(3) NOT NULL,
  150. `time` int(11) DEFAULT NULL,
  151. `author` int(11) NOT NULL,
  152. `text` text,
  153. `title` varchar(120) DEFAULT NULL,
  154. `done` tinyint(3) DEFAULT NULL,
  155. `priority` tinyint(3) DEFAULT NULL,
  156. `closed` tinyint(1) DEFAULT '0',
  157. PRIMARY KEY (`id`),
  158. KEY `author` (`author`)
  159. ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  160.  
  161. --
  162. -- Extraindo dados da tabela `bugtracker`
  163. --
  164.  
  165.  
  166. -- --------------------------------------------------------
  167.  
  168. --
  169. -- Estrutura da tabela `comments`
  170. --
  171.  
  172. CREATE TABLE IF NOT EXISTS `comments` (
  173. `id` int(11) NOT NULL AUTO_INCREMENT,
  174. `news_id` int(11) DEFAULT NULL,
  175. `body` text,
  176. `time` int(11) DEFAULT '0',
  177. `author` int(11) DEFAULT '0',
  178. PRIMARY KEY (`id`),
  179. KEY `news_id` (`news_id`),
  180. KEY `author` (`author`)
  181. ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  182.  
  183. --
  184. -- Extraindo dados da tabela `comments`
  185. --
  186.  
  187.  
  188. -- --------------------------------------------------------
  189.  
  190. --
  191. -- Estrutura da tabela `forums`
  192. --
  193.  
  194. CREATE TABLE IF NOT EXISTS `forums` (
  195. `id` int(11) NOT NULL AUTO_INCREMENT,
  196. `name` varchar(120) DEFAULT NULL,
  197. `description` tinytext,
  198. `access` smallint(5) DEFAULT '1' COMMENT 'Min. access to see the board',
  199. `closed` tinyint(1) DEFAULT NULL,
  200. `moderators` tinytext,
  201. `order` int(6) DEFAULT NULL,
  202. `requireLogin` tinyint(1) DEFAULT NULL,
  203. `guild` int(11) DEFAULT NULL,
  204. PRIMARY KEY (`id`)
  205. ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  206.  
  207. --
  208. -- Extraindo dados da tabela `forums`
  209. --
  210.  
  211.  
  212. -- --------------------------------------------------------
  213.  
  214. --
  215. -- Estrutura da tabela `friends`
  216. --
  217.  
  218. CREATE TABLE IF NOT EXISTS `friends` (
  219. `id` int(11) NOT NULL AUTO_INCREMENT,
  220. `with` int(11) DEFAULT NULL,
  221. `friend` int(11) DEFAULT NULL,
  222. `time` int(11) DEFAULT NULL,
  223. `active` tinyint(1) DEFAULT NULL,
  224. PRIMARY KEY (`id`),
  225. KEY `with` (`with`),
  226. KEY `friend` (`friend`)
  227. ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  228.  
  229. --
  230. -- Extraindo dados da tabela `friends`
  231. --
  232.  
  233.  
  234. -- --------------------------------------------------------
  235.  
  236. --
  237. -- Estrutura da tabela `guilds`
  238. --
  239.  
  240. CREATE TABLE IF NOT EXISTS `guilds` (
  241. `id` int(11) NOT NULL AUTO_INCREMENT,
  242. `world_id` int(11) NOT NULL,
  243. `name` varchar(255) NOT NULL,
  244. `ownerid` int(11) NOT NULL,
  245. `creationdata` int(11) NOT NULL,
  246. `motd` varchar(255) NOT NULL DEFAULT '',
  247. PRIMARY KEY (`id`),
  248. UNIQUE KEY `name` (`name`),
  249. UNIQUE KEY `ownerid` (`ownerid`)
  250. ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  251.  
  252. --
  253. -- Extraindo dados da tabela `guilds`
  254. --
  255.  
  256.  
  257. --
  258. -- Gatilhos `guilds`
  259. --
  260. DROP TRIGGER IF EXISTS `oncreate_guilds`;
  261. DELIMITER //
  262. CREATE TRIGGER `oncreate_guilds` AFTER INSERT ON `guilds`
  263. FOR EACH ROW BEGIN
  264. INSERT INTO `guild_ranks` (`name`, `level`, `guild_id`) VALUES ('the Leader', 3, NEW.`id`);
  265. INSERT INTO `guild_ranks` (`name`, `level`, `guild_id`) VALUES ('a Vice-Leader', 2, NEW.`id`);
  266. INSERT INTO `guild_ranks` (`name`, `level`, `guild_id`) VALUES ('a Member', 1, NEW.`id`);
  267. END
  268. //
  269. DELIMITER ;
  270.  
  271. -- --------------------------------------------------------
  272.  
  273. --
  274. -- Estrutura da tabela `guildwar_kills`
  275. --
  276.  
  277. CREATE TABLE IF NOT EXISTS `guildwar_kills` (
  278. `id` int(11) NOT NULL AUTO_INCREMENT,
  279. `killer` varchar(50) NOT NULL,
  280. `target` varchar(50) NOT NULL,
  281. `killerguild` int(11) NOT NULL DEFAULT '0',
  282. `targetguild` int(11) NOT NULL DEFAULT '0',
  283. `warid` int(11) NOT NULL DEFAULT '0',
  284. `time` bigint(15) NOT NULL,
  285. PRIMARY KEY (`id`),
  286. KEY `warid` (`warid`)
  287. ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  288.  
  289. --
  290. -- Extraindo dados da tabela `guildwar_kills`
  291. --
  292.  
  293.  
  294. -- --------------------------------------------------------
  295.  
  296. --
  297. -- Estrutura da tabela `guild_invites`
  298. --
  299.  
  300. CREATE TABLE IF NOT EXISTS `guild_invites` (
  301. `player_id` int(11) NOT NULL DEFAULT '0',
  302. `guild_id` int(11) NOT NULL DEFAULT '0',
  303. PRIMARY KEY (`player_id`,`guild_id`),
  304. KEY `guild_id` (`guild_id`)
  305. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  306.  
  307. --
  308. -- Extraindo dados da tabela `guild_invites`
  309. --
  310.  
  311.  
  312. -- --------------------------------------------------------
  313.  
  314. --
  315. -- Estrutura da tabela `guild_membership`
  316. --
  317.  
  318. CREATE TABLE IF NOT EXISTS `guild_membership` (
  319. `player_id` int(11) NOT NULL,
  320. `guild_id` int(11) NOT NULL,
  321. `rank_id` int(11) NOT NULL,
  322. `nick` varchar(15) NOT NULL DEFAULT '',
  323. PRIMARY KEY (`player_id`),
  324. KEY `guild_id` (`guild_id`),
  325. KEY `rank_id` (`rank_id`)
  326. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  327.  
  328. --
  329. -- Extraindo dados da tabela `guild_membership`
  330. --
  331.  
  332.  
  333. -- --------------------------------------------------------
  334.  
  335. --
  336. -- Estrutura da tabela `guild_ranks`
  337. --
  338.  
  339. CREATE TABLE IF NOT EXISTS `guild_ranks` (
  340. `id` int(11) NOT NULL AUTO_INCREMENT,
  341. `guild_id` int(11) NOT NULL COMMENT 'guild',
  342. `name` varchar(255) NOT NULL COMMENT 'rank name',
  343. `level` int(11) NOT NULL COMMENT 'rank level - leader, vice, member, maybe something else',
  344. PRIMARY KEY (`id`),
  345. KEY `guild_id` (`guild_id`)
  346. ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  347.  
  348. --
  349. -- Extraindo dados da tabela `guild_ranks`
  350. --
  351.  
  352.  
  353. -- --------------------------------------------------------
  354.  
  355. --
  356. -- Estrutura da tabela `guild_wars`
  357. --
  358.  
  359. CREATE TABLE IF NOT EXISTS `guild_wars` (
  360. `id` int(11) NOT NULL AUTO_INCREMENT,
  361. `guild1` int(11) NOT NULL DEFAULT '0',
  362. `guild2` int(11) NOT NULL DEFAULT '0',
  363. `name1` varchar(255) NOT NULL,
  364. `name2` varchar(255) NOT NULL,
  365. `status` tinyint(2) NOT NULL DEFAULT '0',
  366. `started` bigint(15) NOT NULL DEFAULT '0',
  367. `ended` bigint(15) NOT NULL DEFAULT '0',
  368. PRIMARY KEY (`id`),
  369. KEY `guild1` (`guild1`),
  370. KEY `guild2` (`guild2`)
  371. ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  372.  
  373. --
  374. -- Extraindo dados da tabela `guild_wars`
  375. --
  376.  
  377.  
  378. -- --------------------------------------------------------
  379.  
  380. --
  381. -- Estrutura da tabela `houses`
  382. --
  383.  
  384. CREATE TABLE IF NOT EXISTS `houses` (
  385. `id` int(11) NOT NULL AUTO_INCREMENT,
  386. `owner` int(11) NOT NULL,
  387. `paid` int(10) unsigned NOT NULL DEFAULT '0',
  388. `warnings` int(11) NOT NULL DEFAULT '0',
  389. `name` varchar(255) NOT NULL,
  390. `rent` int(11) NOT NULL DEFAULT '0',
  391. `town_id` int(11) NOT NULL DEFAULT '0',
  392. `bid` int(11) NOT NULL DEFAULT '0',
  393. `bid_end` int(11) NOT NULL DEFAULT '0',
  394. `last_bid` int(11) NOT NULL DEFAULT '0',
  395. `highest_bidder` int(11) NOT NULL DEFAULT '0',
  396. `size` int(11) NOT NULL DEFAULT '0',
  397. `beds` int(11) NOT NULL DEFAULT '0',
  398. PRIMARY KEY (`id`),
  399. KEY `owner` (`owner`),
  400. KEY `town_id` (`town_id`)
  401. ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  402.  
  403. --
  404. -- Extraindo dados da tabela `houses`
  405. --
  406.  
  407.  
  408. -- --------------------------------------------------------
  409.  
  410. --
  411. -- Estrutura da tabela `house_lists`
  412. --
  413.  
  414. CREATE TABLE IF NOT EXISTS `house_lists` (
  415. `house_id` int(11) NOT NULL,
  416. `listid` int(11) NOT NULL,
  417. `list` text NOT NULL,
  418. KEY `house_id` (`house_id`)
  419. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  420.  
  421. --
  422. -- Extraindo dados da tabela `house_lists`
  423. --
  424.  
  425.  
  426. -- --------------------------------------------------------
  427.  
  428. --
  429. -- Estrutura da tabela `ip_bans`
  430. --
  431.  
  432. CREATE TABLE IF NOT EXISTS `ip_bans` (
  433. `ip` int(10) unsigned NOT NULL,
  434. `reason` varchar(255) NOT NULL,
  435. `banned_at` bigint(20) NOT NULL,
  436. `expires_at` bigint(20) NOT NULL,
  437. `banned_by` int(11) NOT NULL,
  438. PRIMARY KEY (`ip`),
  439. KEY `banned_by` (`banned_by`)
  440. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  441.  
  442. --
  443. -- Extraindo dados da tabela `ip_bans`
  444. --
  445.  
  446.  
  447. -- --------------------------------------------------------
  448.  
  449. --
  450. -- Estrutura da tabela `killers`
  451. --
  452.  
  453. CREATE TABLE IF NOT EXISTS `killers` (
  454. `id` int(11) NOT NULL,
  455. `final_hit` int(11) NOT NULL,
  456. `unjustified` int(11) NOT NULL,
  457. PRIMARY KEY (`id`)
  458. ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
  459.  
  460. --
  461. -- Extraindo dados da tabela `killers`
  462. --
  463.  
  464.  
  465. -- --------------------------------------------------------
  466.  
  467. --
  468. -- Estrutura da tabela `live_casts`
  469. --
  470.  
  471. CREATE TABLE IF NOT EXISTS `live_casts` (
  472. `player_id` int(11) NOT NULL,
  473. `cast_name` varchar(255) NOT NULL,
  474. `password` tinyint(1) NOT NULL DEFAULT '0',
  475. `description` varchar(255) DEFAULT NULL,
  476. `spectators` smallint(5) DEFAULT '0',
  477. UNIQUE KEY `player_id_2` (`player_id`)
  478. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  479.  
  480. --
  481. -- Extraindo dados da tabela `live_casts`
  482. --
  483.  
  484.  
  485. -- --------------------------------------------------------
  486.  
  487. --
  488. -- Estrutura da tabela `market_history`
  489. --
  490.  
  491. CREATE TABLE IF NOT EXISTS `market_history` (
  492. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  493. `player_id` int(11) NOT NULL,
  494. `sale` tinyint(1) NOT NULL DEFAULT '0',
  495. `itemtype` int(10) unsigned NOT NULL,
  496. `amount` smallint(5) unsigned NOT NULL,
  497. `price` int(10) unsigned NOT NULL DEFAULT '0',
  498. `expires_at` bigint(20) unsigned NOT NULL,
  499. `inserted` bigint(20) unsigned NOT NULL,
  500. `state` tinyint(1) unsigned NOT NULL,
  501. PRIMARY KEY (`id`),
  502. KEY `player_id` (`player_id`,`sale`)
  503. ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  504.  
  505. --
  506. -- Extraindo dados da tabela `market_history`
  507. --
  508.  
  509.  
  510. -- --------------------------------------------------------
  511.  
  512. --
  513. -- Estrutura da tabela `market_offers`
  514. --
  515.  
  516. CREATE TABLE IF NOT EXISTS `market_offers` (
  517. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  518. `player_id` int(11) NOT NULL,
  519. `sale` tinyint(1) NOT NULL DEFAULT '0',
  520. `itemtype` int(10) unsigned NOT NULL,
  521. `amount` smallint(5) unsigned NOT NULL,
  522. `created` bigint(20) unsigned NOT NULL,
  523. `anonymous` tinyint(1) NOT NULL DEFAULT '0',
  524. `price` int(10) unsigned NOT NULL DEFAULT '0',
  525. PRIMARY KEY (`id`),
  526. KEY `sale` (`sale`,`itemtype`),
  527. KEY `created` (`created`),
  528. KEY `player_id` (`player_id`)
  529. ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  530.  
  531. --
  532. -- Extraindo dados da tabela `market_offers`
  533. --
  534.  
  535.  
  536. -- --------------------------------------------------------
  537.  
  538. --
  539. -- Estrutura da tabela `messages`
  540. --
  541.  
  542. CREATE TABLE IF NOT EXISTS `messages` (
  543. `id` int(11) NOT NULL AUTO_INCREMENT,
  544. `from` int(11) DEFAULT NULL,
  545. `to` int(11) DEFAULT NULL,
  546. `title` varchar(120) DEFAULT NULL,
  547. `text` tinytext,
  548. `time` int(11) DEFAULT NULL,
  549. `delete_from` tinyint(1) DEFAULT NULL,
  550. `delete_to` tinyint(1) DEFAULT NULL,
  551. `unread` tinyint(1) DEFAULT NULL,
  552. PRIMARY KEY (`id`),
  553. KEY `from` (`from`),
  554. KEY `to` (`to`)
  555. ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  556.  
  557. --
  558. -- Extraindo dados da tabela `messages`
  559. --
  560.  
  561.  
  562. -- --------------------------------------------------------
  563.  
  564. --
  565. -- Estrutura da tabela `news`
  566. --
  567.  
  568. CREATE TABLE IF NOT EXISTS `news` (
  569. `id` int(11) NOT NULL AUTO_INCREMENT,
  570. `title` varchar(150) DEFAULT '',
  571. `body` text,
  572. `time` int(11) DEFAULT '0',
  573. PRIMARY KEY (`id`)
  574. ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  575.  
  576. --
  577. -- Extraindo dados da tabela `news`
  578. --
  579.  
  580.  
  581. -- --------------------------------------------------------
  582.  
  583. --
  584. -- Estrutura da tabela `players`
  585. --
  586.  
  587. CREATE TABLE IF NOT EXISTS `players` (
  588. `id` int(11) NOT NULL AUTO_INCREMENT,
  589. `name` varchar(255) NOT NULL,
  590. `group_id` int(11) NOT NULL DEFAULT '1',
  591. `account_id` int(11) NOT NULL DEFAULT '0',
  592. `level` int(11) NOT NULL DEFAULT '1',
  593. `vocation` int(11) NOT NULL DEFAULT '0',
  594. `health` int(11) NOT NULL DEFAULT '150',
  595. `healthmax` int(11) NOT NULL DEFAULT '150',
  596. `experience` bigint(20) NOT NULL DEFAULT '0',
  597. `lookbody` int(11) NOT NULL DEFAULT '0',
  598. `lookfeet` int(11) NOT NULL DEFAULT '0',
  599. `lookhead` int(11) NOT NULL DEFAULT '0',
  600. `looklegs` int(11) NOT NULL DEFAULT '0',
  601. `looktype` int(11) NOT NULL DEFAULT '136',
  602. `lookaddons` int(11) NOT NULL DEFAULT '0',
  603. `maglevel` int(11) NOT NULL DEFAULT '0',
  604. `mana` int(11) NOT NULL DEFAULT '0',
  605. `manamax` int(11) NOT NULL DEFAULT '0',
  606. `manaspent` int(11) unsigned NOT NULL DEFAULT '0',
  607. `soul` int(10) unsigned NOT NULL DEFAULT '0',
  608. `town_id` int(11) NOT NULL DEFAULT '0',
  609. `posx` int(11) NOT NULL DEFAULT '1026',
  610. `posy` int(11) NOT NULL DEFAULT '982',
  611. `posz` int(11) NOT NULL DEFAULT '7',
  612. `conditions` blob NOT NULL,
  613. `cap` int(11) NOT NULL DEFAULT '0',
  614. `sex` int(11) NOT NULL DEFAULT '0',
  615. `lastlogin` bigint(20) unsigned NOT NULL DEFAULT '0',
  616. `lastip` int(10) unsigned NOT NULL DEFAULT '0',
  617. `save` tinyint(1) NOT NULL DEFAULT '1',
  618. `skull` tinyint(1) NOT NULL DEFAULT '0',
  619. `skulltime` int(11) NOT NULL DEFAULT '0',
  620. `lastlogout` bigint(20) unsigned NOT NULL DEFAULT '0',
  621. `blessings` tinyint(2) NOT NULL DEFAULT '0',
  622. `onlinetime` int(11) NOT NULL DEFAULT '0',
  623. `deletion` bigint(15) NOT NULL DEFAULT '0',
  624. `balance` bigint(20) unsigned NOT NULL DEFAULT '0',
  625. `offlinetraining_time` smallint(5) unsigned NOT NULL DEFAULT '43200',
  626. `offlinetraining_skill` int(11) NOT NULL DEFAULT '-1',
  627. `stamina` smallint(5) unsigned NOT NULL DEFAULT '2520',
  628. `skill_fist` int(10) unsigned NOT NULL DEFAULT '10',
  629. `skill_fist_tries` bigint(20) unsigned NOT NULL DEFAULT '0',
  630. `skill_club` int(10) unsigned NOT NULL DEFAULT '10',
  631. `skill_club_tries` bigint(20) unsigned NOT NULL DEFAULT '0',
  632. `skill_sword` int(10) unsigned NOT NULL DEFAULT '10',
  633. `skill_sword_tries` bigint(20) unsigned NOT NULL DEFAULT '0',
  634. `skill_axe` int(10) unsigned NOT NULL DEFAULT '10',
  635. `skill_axe_tries` bigint(20) unsigned NOT NULL DEFAULT '0',
  636. `skill_dist` int(10) unsigned NOT NULL DEFAULT '10',
  637. `skill_dist_tries` bigint(20) unsigned NOT NULL DEFAULT '0',
  638. `skill_shielding` int(10) unsigned NOT NULL DEFAULT '10',
  639. `skill_shielding_tries` bigint(20) unsigned NOT NULL DEFAULT '0',
  640. `skill_fishing` int(10) unsigned NOT NULL DEFAULT '10',
  641. `skill_fishing_tries` bigint(20) unsigned NOT NULL DEFAULT '0',
  642. `old_name` varchar(255) DEFAULT NULL,
  643. `hide_char` int(11) DEFAULT NULL,
  644. `worldtransfer` int(11) DEFAULT NULL,
  645. `created` int(16) DEFAULT NULL,
  646. `nick_verify` int(11) DEFAULT NULL,
  647. `comment` text,
  648. `world_id` int(11) NOT NULL,
  649. `rank_id` int(11) NOT NULL,
  650. `guildnick` int(11) NOT NULL,
  651. `direction` int(11) NOT NULL,
  652. `loss_experience` int(11) NOT NULL,
  653. `loss_mana` int(11) NOT NULL,
  654. `loss_skills` int(11) NOT NULL,
  655. `loss_containers` int(11) NOT NULL,
  656. `loss_items` int(11) NOT NULL,
  657. `premend` int(11) NOT NULL,
  658. `online` int(11) NOT NULL,
  659. `marriage` int(11) NOT NULL,
  660. `promotion` int(11) NOT NULL,
  661. `deleted` int(11) NOT NULL,
  662. `description` int(11) NOT NULL,
  663. PRIMARY KEY (`id`),
  664. UNIQUE KEY `name` (`name`),
  665. KEY `vocation` (`vocation`),
  666. KEY `account_id` (`account_id`)
  667. ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=76 ;
  668.  
  669. --
  670. -- Extraindo dados da tabela `players`
  671.  
  672.  
  673. -- Gatilhos `players`
  674. --
  675. DROP TRIGGER IF EXISTS `ondelete_players`;
  676. DELIMITER //
  677. CREATE TRIGGER `ondelete_players` BEFORE DELETE ON `players`
  678. FOR EACH ROW BEGIN
  679. UPDATE `houses` SET `owner` = 0 WHERE `owner` = OLD.`id`;
  680. END
  681. //
  682. DELIMITER ;
  683.  
  684. -- --------------------------------------------------------
  685.  
  686. --
  687. -- Estrutura da tabela `players_online`
  688. --
  689.  
  690. CREATE TABLE IF NOT EXISTS `players_online` (
  691. `player_id` int(11) NOT NULL,
  692. PRIMARY KEY (`player_id`)
  693. ) ENGINE=MEMORY DEFAULT CHARSET=latin1;
  694.  
  695. --
  696. -- Extraindo dados da tabela `players_online`
  697. --
  698.  
  699.  
  700. -- --------------------------------------------------------
  701.  
  702. --
  703. -- Estrutura da tabela `player_deaths`
  704. --
  705.  
  706. CREATE TABLE IF NOT EXISTS `player_deaths` (
  707. `player_id` int(11) NOT NULL,
  708. `time` bigint(20) unsigned NOT NULL DEFAULT '0',
  709. `level` int(11) NOT NULL DEFAULT '1',
  710. `killed_by` varchar(255) NOT NULL,
  711. `is_player` tinyint(1) NOT NULL DEFAULT '1',
  712. `mostdamage_by` varchar(100) NOT NULL,
  713. `mostdamage_is_player` tinyint(1) NOT NULL DEFAULT '0',
  714. `unjustified` tinyint(1) NOT NULL DEFAULT '0',
  715. `mostdamage_unjustified` tinyint(1) NOT NULL DEFAULT '0',
  716. KEY `player_id` (`player_id`),
  717. KEY `killed_by` (`killed_by`),
  718. KEY `mostdamage_by` (`mostdamage_by`)
  719. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  720.  
  721. --
  722. -- Extraindo dados da tabela `player_deaths`
  723. --
  724.  
  725.  
  726. -- --------------------------------------------------------
  727.  
  728. --
  729. -- Estrutura da tabela `player_depotitems`
  730. --
  731.  
  732. CREATE TABLE IF NOT EXISTS `player_depotitems` (
  733. `player_id` int(11) NOT NULL,
  734. `sid` int(11) NOT NULL COMMENT 'any given range eg 0-100 will be reserved for depot lockers and all > 100 will be then normal items inside depots',
  735. `pid` int(11) NOT NULL DEFAULT '0',
  736. `itemtype` smallint(6) NOT NULL,
  737. `count` smallint(5) NOT NULL DEFAULT '0',
  738. `attributes` blob NOT NULL,
  739. UNIQUE KEY `player_id_2` (`player_id`,`sid`)
  740. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  741.  
  742. --
  743. -- Extraindo dados da tabela `player_depotitems`
  744. --
  745.  
  746.  
  747. -- --------------------------------------------------------
  748.  
  749. --
  750. -- Estrutura da tabela `player_inboxitems`
  751. --
  752.  
  753. CREATE TABLE IF NOT EXISTS `player_inboxitems` (
  754. `player_id` int(11) NOT NULL,
  755. `sid` int(11) NOT NULL,
  756. `pid` int(11) NOT NULL DEFAULT '0',
  757. `itemtype` smallint(6) NOT NULL,
  758. `count` smallint(5) NOT NULL DEFAULT '0',
  759. `attributes` blob NOT NULL,
  760. UNIQUE KEY `player_id_2` (`player_id`,`sid`)
  761. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  762.  
  763. --
  764. -- Extraindo dados da tabela `player_inboxitems`
  765. --
  766.  
  767.  
  768. -- --------------------------------------------------------
  769.  
  770. --
  771. -- Estrutura da tabela `player_items`
  772. --
  773.  
  774. CREATE TABLE IF NOT EXISTS `player_items` (
  775. `player_id` int(11) NOT NULL DEFAULT '0',
  776. `pid` int(11) NOT NULL DEFAULT '0',
  777. `sid` int(11) NOT NULL DEFAULT '0',
  778. `itemtype` smallint(6) NOT NULL DEFAULT '0',
  779. `count` smallint(5) NOT NULL DEFAULT '0',
  780. `attributes` blob NOT NULL,
  781. KEY `player_id` (`player_id`),
  782. KEY `sid` (`sid`)
  783. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  784.  
  785. --
  786. -- Extraindo dados da tabela `player_items`
  787. --
  788.  
  789. -- --------------------------------------------------------
  790.  
  791. --
  792. -- Estrutura da tabela `player_killers`
  793. --
  794.  
  795. CREATE TABLE IF NOT EXISTS `player_killers` (
  796. `id` int(11) NOT NULL,
  797. `player_id` int(11) NOT NULL,
  798. `kill_id` int(11) NOT NULL,
  799. PRIMARY KEY (`id`)
  800. ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
  801.  
  802. --
  803. -- Extraindo dados da tabela `player_killers`
  804. --
  805.  
  806.  
  807. -- --------------------------------------------------------
  808.  
  809. --
  810. -- Estrutura da tabela `player_namelocks`
  811. --
  812.  
  813. CREATE TABLE IF NOT EXISTS `player_namelocks` (
  814. `player_id` int(11) NOT NULL,
  815. `reason` varchar(255) NOT NULL,
  816. `namelocked_at` bigint(20) NOT NULL,
  817. `namelocked_by` int(11) NOT NULL,
  818. PRIMARY KEY (`player_id`),
  819. KEY `namelocked_by` (`namelocked_by`)
  820. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  821.  
  822. --
  823. -- Extraindo dados da tabela `player_namelocks`
  824. --
  825.  
  826.  
  827. -- --------------------------------------------------------
  828.  
  829. --
  830. -- Estrutura da tabela `player_skills`
  831. --
  832.  
  833. CREATE TABLE IF NOT EXISTS `player_skills` (
  834. `id` int(11) NOT NULL,
  835. `skillid` int(11) NOT NULL,
  836. `value` int(11) NOT NULL,
  837. `count` int(11) NOT NULL,
  838. `player_id` int(11) NOT NULL,
  839. PRIMARY KEY (`id`),
  840. KEY `player_id` (`player_id`)
  841. ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
  842.  
  843. --
  844. -- Extraindo dados da tabela `player_skills`
  845. --
  846.  
  847.  
  848. -- --------------------------------------------------------
  849.  
  850. --
  851. -- Estrutura da tabela `player_spells`
  852. --
  853.  
  854. CREATE TABLE IF NOT EXISTS `player_spells` (
  855. `player_id` int(11) NOT NULL,
  856. `name` varchar(255) NOT NULL,
  857. KEY `player_id` (`player_id`)
  858. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  859.  
  860. --
  861. -- Extraindo dados da tabela `player_spells`
  862. --
  863.  
  864.  
  865. -- --------------------------------------------------------
  866.  
  867. --
  868. -- Estrutura da tabela `player_storage`
  869. --
  870.  
  871. CREATE TABLE IF NOT EXISTS `player_storage` (
  872. `player_id` int(11) NOT NULL DEFAULT '0',
  873. `key` int(10) unsigned NOT NULL DEFAULT '0',
  874. `value` int(11) NOT NULL DEFAULT '0',
  875. PRIMARY KEY (`player_id`,`key`)
  876. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  877.  
  878. --
  879. -- Extraindo dados da tabela `player_storage`
  880. --
  881. -- --------------------------------------------------------
  882.  
  883. --
  884. -- Estrutura da tabela `poll`
  885. --
  886.  
  887. CREATE TABLE IF NOT EXISTS `poll` (
  888. `id` int(11) NOT NULL AUTO_INCREMENT,
  889. `question` varchar(150) DEFAULT NULL,
  890. `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  891. `date_start` datetime DEFAULT NULL,
  892. `date_end` datetime DEFAULT NULL,
  893. `status` tinyint(1) NOT NULL DEFAULT '0',
  894. PRIMARY KEY (`id`),
  895. KEY `question` (`question`)
  896. ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  897.  
  898. --
  899. -- Extraindo dados da tabela `poll`
  900. --
  901.  
  902.  
  903. -- --------------------------------------------------------
  904.  
  905. --
  906. -- Estrutura da tabela `poll_answer`
  907. --
  908.  
  909. CREATE TABLE IF NOT EXISTS `poll_answer` (
  910. `id` int(11) NOT NULL AUTO_INCREMENT,
  911. `poll_id` int(11) NOT NULL,
  912. `answer` varchar(150) DEFAULT NULL,
  913. PRIMARY KEY (`id`),
  914. KEY `poll_id` (`poll_id`)
  915. ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  916.  
  917. --
  918. -- Extraindo dados da tabela `poll_answer`
  919. --
  920.  
  921.  
  922. -- --------------------------------------------------------
  923.  
  924. --
  925. -- Estrutura da tabela `poll_votes`
  926. --
  927.  
  928. CREATE TABLE IF NOT EXISTS `poll_votes` (
  929. `id` int(11) NOT NULL AUTO_INCREMENT,
  930. `answer_id` int(11) DEFAULT NULL,
  931. `poll_id` int(11) DEFAULT NULL,
  932. `account_id` int(11) NOT NULL,
  933. PRIMARY KEY (`id`),
  934. KEY `answer_id` (`answer_id`),
  935. KEY `poll_id` (`poll_id`),
  936. KEY `account_id` (`account_id`)
  937. ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  938.  
  939. --
  940. -- Extraindo dados da tabela `poll_votes`
  941. --
  942.  
  943.  
  944. -- --------------------------------------------------------
  945.  
  946. --
  947. -- Estrutura da tabela `posts`
  948. --
  949.  
  950. CREATE TABLE IF NOT EXISTS `posts` (
  951. `id` int(11) NOT NULL AUTO_INCREMENT,
  952. `title` varchar(120) DEFAULT NULL,
  953. `text` text,
  954. `time` int(11) DEFAULT NULL,
  955. `author` varchar(64) DEFAULT NULL,
  956. `board_id` int(11) DEFAULT NULL,
  957. `thread_id` int(11) DEFAULT NULL,
  958. PRIMARY KEY (`id`),
  959. KEY `board_id` (`board_id`),
  960. KEY `thread_id` (`thread_id`)
  961. ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  962.  
  963. --
  964. -- Extraindo dados da tabela `posts`
  965. --
  966.  
  967.  
  968. -- --------------------------------------------------------
  969.  
  970. --
  971. -- Estrutura da tabela `server_config`
  972. --
  973.  
  974. CREATE TABLE IF NOT EXISTS `server_config` (
  975. `config` varchar(50) NOT NULL,
  976. `value` varchar(256) NOT NULL DEFAULT '',
  977. PRIMARY KEY (`config`)
  978. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  979.  
  980. --
  981. -- Extraindo dados da tabela `server_config`
  982. --
  983.  
  984.  
  985. -- --------------------------------------------------------
  986.  
  987. --
  988. -- Estrutura da tabela `server_motd`
  989. --
  990.  
  991. CREATE TABLE IF NOT EXISTS `server_motd` (
  992. `id` int(11) NOT NULL,
  993. `text` varchar(60) NOT NULL,
  994. PRIMARY KEY (`id`)
  995. ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
  996.  
  997. --
  998. -- Extraindo dados da tabela `server_motd`
  999. --
  1000.  
  1001.  
  1002. -- --------------------------------------------------------
  1003.  
  1004. --
  1005. -- Estrutura da tabela `threads`
  1006. --
  1007.  
  1008. CREATE TABLE IF NOT EXISTS `threads` (
  1009. `id` int(11) NOT NULL AUTO_INCREMENT,
  1010. `name` varchar(120) DEFAULT NULL,
  1011. `sticked` tinyint(1) DEFAULT NULL,
  1012. `closed` tinyint(1) DEFAULT NULL,
  1013. `author` varchar(64) DEFAULT NULL,
  1014. `time` int(11) DEFAULT NULL,
  1015. `board_id` int(11) DEFAULT NULL,
  1016. PRIMARY KEY (`id`),
  1017. KEY `board_id` (`board_id`)
  1018. ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  1019.  
  1020. --
  1021. -- Extraindo dados da tabela `threads`
  1022. --
  1023.  
  1024.  
  1025. -- --------------------------------------------------------
  1026.  
  1027. --
  1028. -- Estrutura da tabela `tile_store`
  1029. --
  1030.  
  1031. CREATE TABLE IF NOT EXISTS `tile_store` (
  1032. `house_id` int(11) NOT NULL,
  1033. `data` longblob NOT NULL,
  1034. KEY `house_id` (`house_id`)
  1035. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  1036.  
  1037. --
  1038. -- Extraindo dados da tabela `tile_store`
  1039. --
  1040.  
  1041.  
  1042. -- --------------------------------------------------------
  1043.  
  1044. --
  1045. -- Estrutura da tabela `videos`
  1046. --
  1047.  
  1048. CREATE TABLE IF NOT EXISTS `videos` (
  1049. `id` int(11) NOT NULL AUTO_INCREMENT,
  1050. `author` int(11) DEFAULT NULL,
  1051. `title` varchar(120) DEFAULT NULL,
  1052. `description` tinytext,
  1053. `youtube` varchar(45) DEFAULT NULL,
  1054. `views` int(11) DEFAULT NULL,
  1055. `time` int(11) DEFAULT NULL,
  1056. PRIMARY KEY (`id`),
  1057. KEY `author` (`author`)
  1058. ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  1059.  
  1060. --
  1061. -- Extraindo dados da tabela `videos`
  1062. --
  1063.  
  1064.  
  1065. -- --------------------------------------------------------
  1066.  
  1067. --
  1068. -- Estrutura da tabela `video_comments`
  1069. --
  1070.  
  1071. CREATE TABLE IF NOT EXISTS `video_comments` (
  1072. `id` int(10) NOT NULL AUTO_INCREMENT,
  1073. `author` int(11) DEFAULT NULL,
  1074. `video` int(11) DEFAULT NULL,
  1075. `time` int(11) DEFAULT NULL,
  1076. `text` tinytext,
  1077. PRIMARY KEY (`id`),
  1078. KEY `video` (`video`),
  1079. KEY `author` (`author`)
  1080. ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  1081.  
  1082. --
  1083. -- Extraindo dados da tabela `video_comments`
  1084. --
  1085.  
  1086.  
  1087. --
  1088. -- Restrições para as tabelas dumpadas
  1089. --
  1090.  
  1091. --
  1092. -- Restrições para a tabela `account_bans`
  1093. --
  1094. ALTER TABLE `account_bans`
  1095. ADD CONSTRAINT `account_bans_ibfk_1` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  1096. ADD CONSTRAINT `account_bans_ibfk_2` FOREIGN KEY (`banned_by`) REFERENCES `players` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
  1097.  
  1098. --
  1099. -- Restrições para a tabela `account_ban_history`
  1100. --
  1101. ALTER TABLE `account_ban_history`
  1102. ADD CONSTRAINT `account_ban_history_ibfk_1` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  1103. ADD CONSTRAINT `account_ban_history_ibfk_2` FOREIGN KEY (`banned_by`) REFERENCES `players` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
  1104.  
  1105. --
  1106. -- Restrições para a tabela `account_viplist`
  1107. --
  1108. ALTER TABLE `account_viplist`
  1109. ADD CONSTRAINT `account_viplist_ibfk_1` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE,
  1110. ADD CONSTRAINT `account_viplist_ibfk_2` FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE;
  1111.  
  1112. --
  1113. -- Restrições para a tabela `bugtracker`
  1114. --
  1115. ALTER TABLE `bugtracker`
  1116. ADD CONSTRAINT `bugtracker_ibfk_1` FOREIGN KEY (`author`) REFERENCES `players` (`id`) ON DELETE CASCADE;
  1117.  
  1118. --
  1119. -- Restrições para a tabela `comments`
  1120. --
  1121. ALTER TABLE `comments`
  1122. ADD CONSTRAINT `comments_ibfk_1` FOREIGN KEY (`news_id`) REFERENCES `news` (`id`) ON DELETE CASCADE,
  1123. ADD CONSTRAINT `comments_ibfk_2` FOREIGN KEY (`author`) REFERENCES `players` (`id`) ON DELETE CASCADE;
  1124.  
  1125. --
  1126. -- Restrições para a tabela `friends`
  1127. --
  1128. ALTER TABLE `friends`
  1129. ADD CONSTRAINT `friends_ibfk_1` FOREIGN KEY (`with`) REFERENCES `accounts` (`id`) ON DELETE CASCADE,
  1130. ADD CONSTRAINT `friends_ibfk_2` FOREIGN KEY (`friend`) REFERENCES `accounts` (`id`) ON DELETE CASCADE;
  1131.  
  1132. --
  1133. -- Restrições para a tabela `guilds`
  1134. --
  1135. ALTER TABLE `guilds`
  1136. ADD CONSTRAINT `guilds_ibfk_1` FOREIGN KEY (`ownerid`) REFERENCES `players` (`id`) ON DELETE CASCADE;
  1137.  
  1138. --
  1139. -- Restrições para a tabela `guildwar_kills`
  1140. --
  1141. ALTER TABLE `guildwar_kills`
  1142. ADD CONSTRAINT `guildwar_kills_ibfk_1` FOREIGN KEY (`warid`) REFERENCES `guild_wars` (`id`) ON DELETE CASCADE;
  1143.  
  1144. --
  1145. -- Restrições para a tabela `guild_invites`
  1146. --
  1147. ALTER TABLE `guild_invites`
  1148. ADD CONSTRAINT `guild_invites_ibfk_1` FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE,
  1149. ADD CONSTRAINT `guild_invites_ibfk_2` FOREIGN KEY (`guild_id`) REFERENCES `guilds` (`id`) ON DELETE CASCADE;
  1150.  
  1151. --
  1152. -- Restrições para a tabela `guild_membership`
  1153. --
  1154. ALTER TABLE `guild_membership`
  1155. ADD CONSTRAINT `guild_membership_ibfk_1` FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  1156. ADD CONSTRAINT `guild_membership_ibfk_2` FOREIGN KEY (`guild_id`) REFERENCES `guilds` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  1157. ADD CONSTRAINT `guild_membership_ibfk_3` FOREIGN KEY (`rank_id`) REFERENCES `guild_ranks` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
  1158.  
  1159. --
  1160. -- Restrições para a tabela `guild_ranks`
  1161. --
  1162. ALTER TABLE `guild_ranks`
  1163. ADD CONSTRAINT `guild_ranks_ibfk_1` FOREIGN KEY (`guild_id`) REFERENCES `guilds` (`id`) ON DELETE CASCADE;
  1164.  
  1165. --
  1166. -- Restrições para a tabela `house_lists`
  1167. --
  1168. ALTER TABLE `house_lists`
  1169. ADD CONSTRAINT `house_lists_ibfk_1` FOREIGN KEY (`house_id`) REFERENCES `houses` (`id`) ON DELETE CASCADE;
  1170.  
  1171. --
  1172. -- Restrições para a tabela `ip_bans`
  1173. --
  1174. ALTER TABLE `ip_bans`
  1175. ADD CONSTRAINT `ip_bans_ibfk_1` FOREIGN KEY (`banned_by`) REFERENCES `players` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
  1176.  
  1177. --
  1178. -- Restrições para a tabela `live_casts`
  1179. --
  1180. ALTER TABLE `live_casts`
  1181. ADD CONSTRAINT `live_casts_ibfk_1` FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE;
  1182.  
  1183. --
  1184. -- Restrições para a tabela `market_history`
  1185. --
  1186. ALTER TABLE `market_history`
  1187. ADD CONSTRAINT `market_history_ibfk_1` FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE;
  1188.  
  1189. --
  1190. -- Restrições para a tabela `market_offers`
  1191. --
  1192. ALTER TABLE `market_offers`
  1193. ADD CONSTRAINT `market_offers_ibfk_1` FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE;
  1194.  
  1195. --
  1196. -- Restrições para a tabela `messages`
  1197. --
  1198. ALTER TABLE `messages`
  1199. ADD CONSTRAINT `messages_ibfk_1` FOREIGN KEY (`from`) REFERENCES `accounts` (`id`) ON DELETE CASCADE,
  1200. ADD CONSTRAINT `messages_ibfk_2` FOREIGN KEY (`to`) REFERENCES `accounts` (`id`) ON DELETE CASCADE;
  1201.  
  1202. --
  1203. -- Restrições para a tabela `players`
  1204. --
  1205. ALTER TABLE `players`
  1206. ADD CONSTRAINT `players_ibfk_1` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE;
  1207.  
  1208. --
  1209. -- Restrições para a tabela `player_deaths`
  1210. --
  1211. ALTER TABLE `player_deaths`
  1212. ADD CONSTRAINT `player_deaths_ibfk_1` FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE;
  1213.  
  1214. --
  1215. -- Restrições para a tabela `player_depotitems`
  1216. --
  1217. ALTER TABLE `player_depotitems`
  1218. ADD CONSTRAINT `player_depotitems_ibfk_1` FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE;
  1219.  
  1220. --
  1221. -- Restrições para a tabela `player_inboxitems`
  1222. --
  1223. ALTER TABLE `player_inboxitems`
  1224. ADD CONSTRAINT `player_inboxitems_ibfk_1` FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE;
  1225.  
  1226. --
  1227. -- Restrições para a tabela `player_items`
  1228. --
  1229. ALTER TABLE `player_items`
  1230. ADD CONSTRAINT `player_items_ibfk_1` FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE;
  1231.  
  1232. --
  1233. -- Restrições para a tabela `player_namelocks`
  1234. --
  1235. ALTER TABLE `player_namelocks`
  1236. ADD CONSTRAINT `player_namelocks_ibfk_1` FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  1237. ADD CONSTRAINT `player_namelocks_ibfk_2` FOREIGN KEY (`namelocked_by`) REFERENCES `players` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
  1238.  
  1239. --
  1240. -- Restrições para a tabela `player_spells`
  1241. --
  1242. ALTER TABLE `player_spells`
  1243. ADD CONSTRAINT `player_spells_ibfk_1` FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE;
  1244.  
  1245. --
  1246. -- Restrições para a tabela `player_storage`
  1247. --
  1248. ALTER TABLE `player_storage`
  1249. ADD CONSTRAINT `player_storage_ibfk_1` FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE;
  1250.  
  1251. --
  1252. -- Restrições para a tabela `poll_answer`
  1253. --
  1254. ALTER TABLE `poll_answer`
  1255. ADD CONSTRAINT `poll_answer_ibfk_1` FOREIGN KEY (`poll_id`) REFERENCES `poll` (`id`) ON DELETE CASCADE;
  1256.  
  1257. --
  1258. -- Restrições para a tabela `poll_votes`
  1259. --
  1260. ALTER TABLE `poll_votes`
  1261. ADD CONSTRAINT `poll_votes_ibfk_1` FOREIGN KEY (`answer_id`) REFERENCES `poll_answer` (`id`) ON DELETE CASCADE,
  1262. ADD CONSTRAINT `poll_votes_ibfk_2` FOREIGN KEY (`poll_id`) REFERENCES `poll` (`id`) ON DELETE CASCADE,
  1263. ADD CONSTRAINT `poll_votes_ibfk_3` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE;
  1264.  
  1265. --
  1266. -- Restrições para a tabela `posts`
  1267. --
  1268. ALTER TABLE `posts`
  1269. ADD CONSTRAINT `posts_ibfk_1` FOREIGN KEY (`board_id`) REFERENCES `forums` (`id`) ON DELETE CASCADE,
  1270. ADD CONSTRAINT `posts_ibfk_2` FOREIGN KEY (`thread_id`) REFERENCES `threads` (`id`) ON DELETE CASCADE;
  1271.  
  1272. --
  1273. -- Restrições para a tabela `threads`
  1274. --
  1275. ALTER TABLE `threads`
  1276. ADD CONSTRAINT `threads_ibfk_1` FOREIGN KEY (`board_id`) REFERENCES `forums` (`id`) ON DELETE CASCADE;
  1277.  
  1278. --
  1279. -- Restrições para a tabela `tile_store`
  1280. --
  1281. ALTER TABLE `tile_store`
  1282. ADD CONSTRAINT `tile_store_ibfk_1` FOREIGN KEY (`house_id`) REFERENCES `houses` (`id`) ON DELETE CASCADE;
  1283.  
  1284. --
  1285. -- Restrições para a tabela `videos`
  1286. --
  1287. ALTER TABLE `videos`
  1288. ADD CONSTRAINT `videos_ibfk_1` FOREIGN KEY (`author`) REFERENCES `players` (`id`) ON DELETE CASCADE;
  1289.  
  1290. --
  1291. -- Restrições para a tabela `video_comments`
  1292. --
  1293. ALTER TABLE `video_comments`
  1294. ADD CONSTRAINT `video_comments_ibfk_1` FOREIGN KEY (`video`) REFERENCES `videos` (`id`) ON DELETE CASCADE,
  1295. ADD CONSTRAINT `video_comments_ibfk_2` FOREIGN KEY (`author`) REFERENCES `players` (`id`) ON DELETE CASCADE;
  1296.  
  1297. /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
  1298. /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
  1299. /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement