mirror of
https://github.com/ErikasKontenis/SabrehavenServer.git
synced 2025-04-30 01:29:21 +02:00
606 lines
19 KiB
SQL
606 lines
19 KiB
SQL
-- phpMyAdmin SQL Dump
|
|
-- version 4.0.5
|
|
-- http://www.phpmyadmin.net
|
|
--
|
|
-- Host: 127.0.0.1:3306
|
|
|
|
-- Generation Time: May 17, 2017 at 12:09 AM
|
|
-- Server version: 5.5.33
|
|
-- PHP Version: 5.4.19
|
|
|
|
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
|
|
SET time_zone = "+00:00";
|
|
|
|
--
|
|
-- Database: `neloria`
|
|
--
|
|
|
|
-- --------------------------------------------------------
|
|
|
|
--
|
|
-- Table structure for table `accounts`
|
|
--
|
|
|
|
CREATE TABLE `accounts` (
|
|
`id` int(11) NOT NULL,
|
|
`password` char(40) NOT NULL,
|
|
`type` int(11) NOT NULL DEFAULT '1',
|
|
`premdays` int(11) NOT NULL DEFAULT '0',
|
|
`lastday` int(10) unsigned NOT NULL DEFAULT '0',
|
|
PRIMARY KEY (`id`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
|
|
|
--
|
|
-- Dumping data for table `accounts`
|
|
--
|
|
|
|
INSERT INTO `accounts` (`id`, `password`, `type`, `premdays`, `lastday`) VALUES
|
|
(1234567, '41da8bef22aaef9d7c5821fa0f0de7cccc4dda4d', 5, 600, 1494975990);
|
|
|
|
-- --------------------------------------------------------
|
|
|
|
--
|
|
-- Table structure for table `account_bans`
|
|
--
|
|
|
|
CREATE TABLE `account_bans` (
|
|
`account_id` int(11) NOT NULL,
|
|
`reason` varchar(255) NOT NULL,
|
|
`banned_at` bigint(20) NOT NULL,
|
|
`expires_at` bigint(20) NOT NULL,
|
|
`banned_by` int(11) NOT NULL,
|
|
PRIMARY KEY (`account_id`),
|
|
KEY `banned_by` (`banned_by`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
|
|
|
-- --------------------------------------------------------
|
|
|
|
--
|
|
-- Table structure for table `account_ban_history`
|
|
--
|
|
|
|
CREATE TABLE `account_ban_history` (
|
|
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
|
`account_id` int(11) NOT NULL,
|
|
`reason` varchar(255) NOT NULL,
|
|
`banned_at` bigint(20) NOT NULL,
|
|
`expired_at` bigint(20) NOT NULL,
|
|
`banned_by` int(11) NOT NULL,
|
|
PRIMARY KEY (`id`),
|
|
KEY `account_id` (`account_id`),
|
|
KEY `banned_by` (`banned_by`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
|
|
|
-- --------------------------------------------------------
|
|
|
|
--
|
|
-- Table structure for table `account_viplist`
|
|
--
|
|
|
|
CREATE TABLE `account_viplist` (
|
|
`account_id` int(11) NOT NULL COMMENT 'id of account whose viplist entry it is',
|
|
`player_id` int(11) NOT NULL COMMENT 'id of target player of viplist entry',
|
|
`description` varchar(128) NOT NULL DEFAULT '',
|
|
`icon` tinyint(2) unsigned NOT NULL DEFAULT '0',
|
|
`notify` tinyint(1) NOT NULL DEFAULT '0',
|
|
UNIQUE KEY `account_player_index` (`account_id`,`player_id`),
|
|
KEY `player_id` (`player_id`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
|
|
|
-- --------------------------------------------------------
|
|
|
|
--
|
|
-- Table structure for table `guilds`
|
|
--
|
|
|
|
CREATE TABLE `guilds` (
|
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
|
`name` varchar(255) NOT NULL,
|
|
`ownerid` int(11) NOT NULL,
|
|
`creationdata` int(11) NOT NULL,
|
|
PRIMARY KEY (`id`),
|
|
UNIQUE KEY `name` (`name`),
|
|
UNIQUE KEY `ownerid` (`ownerid`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
|
|
|
--
|
|
-- Triggers `guilds`
|
|
--
|
|
DROP TRIGGER IF EXISTS `oncreate_guilds`;
|
|
DELIMITER //
|
|
CREATE TRIGGER `oncreate_guilds` AFTER INSERT ON `guilds`
|
|
FOR EACH ROW BEGIN
|
|
INSERT INTO `guild_ranks` (`name`, `level`, `guild_id`) VALUES ('the Leader', 3, NEW.`id`);
|
|
INSERT INTO `guild_ranks` (`name`, `level`, `guild_id`) VALUES ('a Vice-Leader', 2, NEW.`id`);
|
|
INSERT INTO `guild_ranks` (`name`, `level`, `guild_id`) VALUES ('a Member', 1, NEW.`id`);
|
|
END
|
|
//
|
|
DELIMITER ;
|
|
|
|
-- --------------------------------------------------------
|
|
|
|
--
|
|
-- Table structure for table `guildwar_kills`
|
|
--
|
|
|
|
CREATE TABLE `guildwar_kills` (
|
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
|
`killer` varchar(50) NOT NULL,
|
|
`target` varchar(50) NOT NULL,
|
|
`killerguild` int(11) NOT NULL DEFAULT '0',
|
|
`targetguild` int(11) NOT NULL DEFAULT '0',
|
|
`warid` int(11) NOT NULL DEFAULT '0',
|
|
`time` bigint(15) NOT NULL,
|
|
PRIMARY KEY (`id`),
|
|
KEY `warid` (`warid`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=8 ;
|
|
|
|
-- --------------------------------------------------------
|
|
|
|
--
|
|
-- Table structure for table `guild_invites`
|
|
--
|
|
|
|
CREATE TABLE `guild_invites` (
|
|
`player_id` int(11) NOT NULL DEFAULT '0',
|
|
`guild_id` int(11) NOT NULL DEFAULT '0',
|
|
PRIMARY KEY (`player_id`,`guild_id`),
|
|
KEY `guild_id` (`guild_id`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
|
|
|
-- --------------------------------------------------------
|
|
|
|
--
|
|
-- Table structure for table `guild_membership`
|
|
--
|
|
|
|
CREATE TABLE `guild_membership` (
|
|
`player_id` int(11) NOT NULL,
|
|
`guild_id` int(11) NOT NULL,
|
|
`rank_id` int(11) NOT NULL,
|
|
`nick` varchar(15) NOT NULL DEFAULT '',
|
|
PRIMARY KEY (`player_id`),
|
|
KEY `guild_id` (`guild_id`),
|
|
KEY `rank_id` (`rank_id`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
|
|
|
-- --------------------------------------------------------
|
|
|
|
--
|
|
-- Table structure for table `guild_ranks`
|
|
--
|
|
|
|
CREATE TABLE `guild_ranks` (
|
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
|
`guild_id` int(11) NOT NULL COMMENT 'guild',
|
|
`name` varchar(255) NOT NULL COMMENT 'rank name',
|
|
`level` int(11) NOT NULL COMMENT 'rank level - leader, vice, member, maybe something else',
|
|
PRIMARY KEY (`id`),
|
|
KEY `guild_id` (`guild_id`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
|
|
|
-- --------------------------------------------------------
|
|
|
|
--
|
|
-- Table structure for table `guild_wars`
|
|
--
|
|
|
|
CREATE TABLE `guild_wars` (
|
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
|
`guild1` int(11) NOT NULL DEFAULT '0',
|
|
`guild2` int(11) NOT NULL DEFAULT '0',
|
|
`name1` varchar(255) NOT NULL,
|
|
`name2` varchar(255) NOT NULL,
|
|
`status` tinyint(2) NOT NULL DEFAULT '0',
|
|
`started` bigint(15) NOT NULL DEFAULT '0',
|
|
`ended` bigint(15) NOT NULL DEFAULT '0',
|
|
PRIMARY KEY (`id`),
|
|
KEY `guild1` (`guild1`),
|
|
KEY `guild2` (`guild2`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
|
|
|
-- --------------------------------------------------------
|
|
|
|
--
|
|
-- Table structure for table `houses`
|
|
--
|
|
|
|
CREATE TABLE `houses` (
|
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
|
`owner` int(11) NOT NULL,
|
|
`paid` int(10) unsigned NOT NULL DEFAULT '0',
|
|
`warnings` int(11) NOT NULL DEFAULT '0',
|
|
`name` varchar(255) NOT NULL,
|
|
`rent` int(11) NOT NULL DEFAULT '0',
|
|
`town_id` int(11) NOT NULL DEFAULT '0',
|
|
`bid` int(11) NOT NULL DEFAULT '0',
|
|
`bid_end` int(11) NOT NULL DEFAULT '0',
|
|
`last_bid` int(11) NOT NULL DEFAULT '0',
|
|
`highest_bidder` int(11) NOT NULL DEFAULT '0',
|
|
`size` int(11) NOT NULL DEFAULT '0',
|
|
`beds` int(11) NOT NULL DEFAULT '0',
|
|
PRIMARY KEY (`id`),
|
|
KEY `owner` (`owner`),
|
|
KEY `town_id` (`town_id`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=862 ;
|
|
|
|
-- --------------------------------------------------------
|
|
|
|
--
|
|
-- Table structure for table `house_lists`
|
|
--
|
|
|
|
CREATE TABLE `house_lists` (
|
|
`house_id` int(11) NOT NULL,
|
|
`listid` int(11) NOT NULL,
|
|
`list` text NOT NULL,
|
|
KEY `house_id` (`house_id`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
|
|
|
-- --------------------------------------------------------
|
|
|
|
--
|
|
-- Table structure for table `ip_bans`
|
|
--
|
|
|
|
CREATE TABLE `ip_bans` (
|
|
`ip` int(10) unsigned NOT NULL,
|
|
`reason` varchar(255) NOT NULL,
|
|
`banned_at` bigint(20) NOT NULL,
|
|
`expires_at` bigint(20) NOT NULL,
|
|
`banned_by` int(11) NOT NULL,
|
|
PRIMARY KEY (`ip`),
|
|
KEY `banned_by` (`banned_by`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
|
|
|
-- --------------------------------------------------------
|
|
|
|
--
|
|
-- Table structure for table `players`
|
|
--
|
|
|
|
CREATE TABLE `players` (
|
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
|
`name` varchar(255) NOT NULL,
|
|
`group_id` int(11) NOT NULL DEFAULT '1',
|
|
`account_id` int(11) NOT NULL DEFAULT '0',
|
|
`level` int(11) NOT NULL DEFAULT '1',
|
|
`vocation` int(11) NOT NULL DEFAULT '0',
|
|
`health` int(11) NOT NULL DEFAULT '150',
|
|
`healthmax` int(11) NOT NULL DEFAULT '150',
|
|
`experience` bigint(20) NOT NULL DEFAULT '0',
|
|
`lookbody` int(11) NOT NULL DEFAULT '0',
|
|
`lookfeet` int(11) NOT NULL DEFAULT '0',
|
|
`lookhead` int(11) NOT NULL DEFAULT '0',
|
|
`looklegs` int(11) NOT NULL DEFAULT '0',
|
|
`looktype` int(11) NOT NULL DEFAULT '136',
|
|
`maglevel` int(11) NOT NULL DEFAULT '0',
|
|
`mana` int(11) NOT NULL DEFAULT '0',
|
|
`manamax` int(11) NOT NULL DEFAULT '0',
|
|
`manaspent` int(11) unsigned NOT NULL DEFAULT '0',
|
|
`soul` int(10) unsigned NOT NULL DEFAULT '0',
|
|
`town_id` int(11) NOT NULL DEFAULT '0',
|
|
`posx` int(11) NOT NULL DEFAULT '0',
|
|
`posy` int(11) NOT NULL DEFAULT '0',
|
|
`posz` int(11) NOT NULL DEFAULT '0',
|
|
`conditions` blob NOT NULL,
|
|
`cap` int(11) NOT NULL DEFAULT '0',
|
|
`sex` int(11) NOT NULL DEFAULT '0',
|
|
`lastlogin` bigint(20) unsigned NOT NULL DEFAULT '0',
|
|
`lastip` int(10) unsigned NOT NULL DEFAULT '0',
|
|
`save` tinyint(1) NOT NULL DEFAULT '1',
|
|
`skull` tinyint(1) NOT NULL DEFAULT '0',
|
|
`skulltime` int(11) NOT NULL DEFAULT '0',
|
|
`lastlogout` bigint(20) unsigned NOT NULL DEFAULT '0',
|
|
`blessings` tinyint(2) NOT NULL DEFAULT '0',
|
|
`onlinetime` int(11) NOT NULL DEFAULT '0',
|
|
`deletion` bigint(15) NOT NULL DEFAULT '0',
|
|
`balance` bigint(20) unsigned NOT NULL DEFAULT '0',
|
|
`skill_fist` int(10) unsigned NOT NULL DEFAULT '10',
|
|
`skill_fist_tries` bigint(20) unsigned NOT NULL DEFAULT '0',
|
|
`skill_club` int(10) unsigned NOT NULL DEFAULT '10',
|
|
`skill_club_tries` bigint(20) unsigned NOT NULL DEFAULT '0',
|
|
`skill_sword` int(10) unsigned NOT NULL DEFAULT '10',
|
|
`skill_sword_tries` bigint(20) unsigned NOT NULL DEFAULT '0',
|
|
`skill_axe` int(10) unsigned NOT NULL DEFAULT '10',
|
|
`skill_axe_tries` bigint(20) unsigned NOT NULL DEFAULT '0',
|
|
`skill_dist` int(10) unsigned NOT NULL DEFAULT '10',
|
|
`skill_dist_tries` bigint(20) unsigned NOT NULL DEFAULT '0',
|
|
`skill_shielding` int(10) unsigned NOT NULL DEFAULT '10',
|
|
`skill_shielding_tries` bigint(20) unsigned NOT NULL DEFAULT '0',
|
|
`skill_fishing` int(10) unsigned NOT NULL DEFAULT '10',
|
|
`skill_fishing_tries` bigint(20) unsigned NOT NULL DEFAULT '0',
|
|
`deleted` tinyint(1) NOT NULL DEFAULT '0',
|
|
PRIMARY KEY (`id`),
|
|
UNIQUE KEY `name` (`name`),
|
|
KEY `account_id` (`account_id`),
|
|
KEY `vocation` (`vocation`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;
|
|
|
|
--
|
|
-- Dumping data for table `players`
|
|
--
|
|
|
|
INSERT INTO `players` (`id`, `name`, `group_id`, `account_id`, `level`, `vocation`, `health`, `healthmax`, `experience`, `lookbody`, `lookfeet`, `lookhead`, `looklegs`, `looktype`, `maglevel`, `mana`, `manamax`, `manaspent`, `soul`, `town_id`, `posx`, `posy`, `posz`, `conditions`, `cap`, `sex`, `lastlogin`, `lastip`, `save`, `skull`, `skulltime`, `lastlogout`, `blessings`, `onlinetime`, `deletion`, `balance`, `skill_fist`, `skill_fist_tries`, `skill_club`, `skill_club_tries`, `skill_sword`, `skill_sword_tries`, `skill_axe`, `skill_axe_tries`, `skill_dist`, `skill_dist_tries`, `skill_shielding`, `skill_shielding_tries`, `skill_fishing`, `skill_fishing_tries`, `deleted`) VALUES
|
|
(1, 'GM Nostalrius', 3, 1234567, 2, 0, 155, 155, 105, 106, 95, 78, 58, 75, 0, 5, 5, 0, 100, 10, 32316, 31942, 7, '', 405, 0, 1494975992, 16777343, 1, 0, 0, 1494976015, 0, 23, 0, 0, 10, 0, 10, 0, 10, 0, 10, 0, 10, 0, 10, 0, 10, 0, 0);
|
|
|
|
--
|
|
-- Triggers `players`
|
|
--
|
|
DROP TRIGGER IF EXISTS `ondelete_players`;
|
|
DELIMITER //
|
|
CREATE TRIGGER `ondelete_players` BEFORE DELETE ON `players`
|
|
FOR EACH ROW BEGIN
|
|
UPDATE `houses` SET `owner` = 0 WHERE `owner` = OLD.`id`;
|
|
END
|
|
//
|
|
DELIMITER ;
|
|
|
|
-- --------------------------------------------------------
|
|
|
|
--
|
|
-- Table structure for table `players_online`
|
|
--
|
|
|
|
CREATE TABLE `players_online` (
|
|
`player_id` int(11) NOT NULL,
|
|
PRIMARY KEY (`player_id`)
|
|
) ENGINE=MEMORY DEFAULT CHARSET=utf8;
|
|
|
|
-- --------------------------------------------------------
|
|
|
|
--
|
|
-- Table structure for table `player_deaths`
|
|
--
|
|
|
|
CREATE TABLE `player_deaths` (
|
|
`player_id` int(11) NOT NULL,
|
|
`time` bigint(20) unsigned NOT NULL DEFAULT '0',
|
|
`level` int(11) NOT NULL DEFAULT '1',
|
|
`killed_by` varchar(255) NOT NULL,
|
|
`is_player` tinyint(1) NOT NULL DEFAULT '1',
|
|
`mostdamage_by` varchar(100) NOT NULL,
|
|
`mostdamage_is_player` tinyint(1) NOT NULL DEFAULT '0',
|
|
`unjustified` tinyint(1) NOT NULL DEFAULT '0',
|
|
`mostdamage_unjustified` tinyint(1) NOT NULL DEFAULT '0',
|
|
KEY `player_id` (`player_id`),
|
|
KEY `killed_by` (`killed_by`),
|
|
KEY `mostdamage_by` (`mostdamage_by`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
|
|
|
-- --------------------------------------------------------
|
|
|
|
--
|
|
-- Table structure for table `player_depotitems`
|
|
--
|
|
|
|
CREATE TABLE `player_depotitems` (
|
|
`player_id` int(11) NOT NULL,
|
|
`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',
|
|
`pid` int(11) NOT NULL DEFAULT '0',
|
|
`itemtype` smallint(6) NOT NULL,
|
|
`count` smallint(5) NOT NULL DEFAULT '0',
|
|
`attributes` blob NOT NULL,
|
|
UNIQUE KEY `player_id_2` (`player_id`,`sid`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
|
|
|
-- --------------------------------------------------------
|
|
|
|
--
|
|
-- Table structure for table `player_items`
|
|
--
|
|
|
|
CREATE TABLE `player_items` (
|
|
`player_id` int(11) NOT NULL DEFAULT '0',
|
|
`pid` int(11) NOT NULL DEFAULT '0',
|
|
`sid` int(11) NOT NULL DEFAULT '0',
|
|
`itemtype` smallint(6) NOT NULL DEFAULT '0',
|
|
`count` smallint(5) NOT NULL DEFAULT '0',
|
|
`attributes` blob NOT NULL,
|
|
KEY `player_id` (`player_id`),
|
|
KEY `sid` (`sid`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
|
|
|
--
|
|
-- Dumping data for table `player_items`
|
|
--
|
|
|
|
INSERT INTO `player_items` (`player_id`, `pid`, `sid`, `itemtype`, `count`, `attributes`) VALUES
|
|
(1, 3, 101, 2853, 1, ''),
|
|
(1, 4, 102, 3562, 1, ''),
|
|
(1, 5, 103, 2920, 1, ''),
|
|
(1, 6, 104, 3270, 1, ''),
|
|
(1, 101, 105, 3585, 1, 0x0f01);
|
|
|
|
-- --------------------------------------------------------
|
|
|
|
--
|
|
-- Table structure for table `player_namelocks`
|
|
--
|
|
|
|
CREATE TABLE `player_namelocks` (
|
|
`player_id` int(11) NOT NULL,
|
|
`reason` varchar(255) NOT NULL,
|
|
`namelocked_at` bigint(20) NOT NULL,
|
|
`namelocked_by` int(11) NOT NULL,
|
|
PRIMARY KEY (`player_id`),
|
|
KEY `namelocked_by` (`namelocked_by`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
|
|
|
-- --------------------------------------------------------
|
|
|
|
--
|
|
-- Table structure for table `player_spells`
|
|
--
|
|
|
|
CREATE TABLE `player_spells` (
|
|
`player_id` int(11) NOT NULL,
|
|
`name` varchar(255) NOT NULL,
|
|
KEY `player_id` (`player_id`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
|
|
|
-- --------------------------------------------------------
|
|
|
|
--
|
|
-- Table structure for table `player_storage`
|
|
--
|
|
|
|
CREATE TABLE `player_storage` (
|
|
`player_id` int(11) NOT NULL DEFAULT '0',
|
|
`key` int(10) unsigned NOT NULL DEFAULT '0',
|
|
`value` int(11) NOT NULL DEFAULT '0',
|
|
PRIMARY KEY (`player_id`,`key`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
|
|
|
-- --------------------------------------------------------
|
|
|
|
--
|
|
-- Table structure for table `server_config`
|
|
--
|
|
|
|
CREATE TABLE `server_config` (
|
|
`config` varchar(50) NOT NULL,
|
|
`value` varchar(256) NOT NULL DEFAULT '',
|
|
PRIMARY KEY (`config`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
|
|
|
--
|
|
-- Dumping data for table `server_config`
|
|
--
|
|
|
|
INSERT INTO `server_config` (`config`, `value`) VALUES
|
|
('motd_hash', '0'),
|
|
('motd_num', '0'),
|
|
('players_record', '0');
|
|
|
|
-- --------------------------------------------------------
|
|
|
|
--
|
|
-- Table structure for table `tile_store`
|
|
--
|
|
|
|
CREATE TABLE `tile_store` (
|
|
`house_id` int(11) NOT NULL,
|
|
`data` longblob NOT NULL,
|
|
KEY `house_id` (`house_id`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
|
|
|
--
|
|
-- Constraints for dumped tables
|
|
--
|
|
|
|
--
|
|
-- Constraints for table `account_bans`
|
|
--
|
|
ALTER TABLE `account_bans`
|
|
ADD CONSTRAINT `account_bans_ibfk_1` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
|
ADD CONSTRAINT `account_bans_ibfk_2` FOREIGN KEY (`banned_by`) REFERENCES `players` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
|
|
|
|
--
|
|
-- Constraints for table `account_ban_history`
|
|
--
|
|
ALTER TABLE `account_ban_history`
|
|
ADD CONSTRAINT `account_ban_history_ibfk_1` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
|
ADD CONSTRAINT `account_ban_history_ibfk_2` FOREIGN KEY (`banned_by`) REFERENCES `players` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
|
|
|
|
--
|
|
-- Constraints for table `account_viplist`
|
|
--
|
|
ALTER TABLE `account_viplist`
|
|
ADD CONSTRAINT `account_viplist_ibfk_1` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE,
|
|
ADD CONSTRAINT `account_viplist_ibfk_2` FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE;
|
|
|
|
--
|
|
-- Constraints for table `guilds`
|
|
--
|
|
ALTER TABLE `guilds`
|
|
ADD CONSTRAINT `guilds_ibfk_1` FOREIGN KEY (`ownerid`) REFERENCES `players` (`id`) ON DELETE CASCADE;
|
|
|
|
--
|
|
-- Constraints for table `guildwar_kills`
|
|
--
|
|
ALTER TABLE `guildwar_kills`
|
|
ADD CONSTRAINT `guildwar_kills_ibfk_1` FOREIGN KEY (`warid`) REFERENCES `guild_wars` (`id`) ON DELETE CASCADE;
|
|
|
|
--
|
|
-- Constraints for table `guild_invites`
|
|
--
|
|
ALTER TABLE `guild_invites`
|
|
ADD CONSTRAINT `guild_invites_ibfk_1` FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE,
|
|
ADD CONSTRAINT `guild_invites_ibfk_2` FOREIGN KEY (`guild_id`) REFERENCES `guilds` (`id`) ON DELETE CASCADE;
|
|
|
|
--
|
|
-- Constraints for table `guild_membership`
|
|
--
|
|
ALTER TABLE `guild_membership`
|
|
ADD CONSTRAINT `guild_membership_ibfk_1` FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
|
ADD CONSTRAINT `guild_membership_ibfk_2` FOREIGN KEY (`guild_id`) REFERENCES `guilds` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
|
ADD CONSTRAINT `guild_membership_ibfk_3` FOREIGN KEY (`rank_id`) REFERENCES `guild_ranks` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
|
|
|
|
--
|
|
-- Constraints for table `guild_ranks`
|
|
--
|
|
ALTER TABLE `guild_ranks`
|
|
ADD CONSTRAINT `guild_ranks_ibfk_1` FOREIGN KEY (`guild_id`) REFERENCES `guilds` (`id`) ON DELETE CASCADE;
|
|
|
|
--
|
|
-- Constraints for table `house_lists`
|
|
--
|
|
ALTER TABLE `house_lists`
|
|
ADD CONSTRAINT `house_lists_ibfk_1` FOREIGN KEY (`house_id`) REFERENCES `houses` (`id`) ON DELETE CASCADE;
|
|
|
|
--
|
|
-- Constraints for table `ip_bans`
|
|
--
|
|
ALTER TABLE `ip_bans`
|
|
ADD CONSTRAINT `ip_bans_ibfk_1` FOREIGN KEY (`banned_by`) REFERENCES `players` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
|
|
|
|
--
|
|
-- Constraints for table `players`
|
|
--
|
|
ALTER TABLE `players`
|
|
ADD CONSTRAINT `players_ibfk_1` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE;
|
|
|
|
--
|
|
-- Constraints for table `player_deaths`
|
|
--
|
|
ALTER TABLE `player_deaths`
|
|
ADD CONSTRAINT `player_deaths_ibfk_1` FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE;
|
|
|
|
--
|
|
-- Constraints for table `player_depotitems`
|
|
--
|
|
ALTER TABLE `player_depotitems`
|
|
ADD CONSTRAINT `player_depotitems_ibfk_1` FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE;
|
|
|
|
--
|
|
-- Constraints for table `player_items`
|
|
--
|
|
ALTER TABLE `player_items`
|
|
ADD CONSTRAINT `player_items_ibfk_1` FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE;
|
|
|
|
--
|
|
-- Constraints for table `player_namelocks`
|
|
--
|
|
ALTER TABLE `player_namelocks`
|
|
ADD CONSTRAINT `player_namelocks_ibfk_1` FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
|
ADD CONSTRAINT `player_namelocks_ibfk_2` FOREIGN KEY (`namelocked_by`) REFERENCES `players` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
|
|
|
|
--
|
|
-- Constraints for table `player_spells`
|
|
--
|
|
ALTER TABLE `player_spells`
|
|
ADD CONSTRAINT `player_spells_ibfk_1` FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE;
|
|
|
|
--
|
|
-- Constraints for table `player_storage`
|
|
--
|
|
ALTER TABLE `player_storage`
|
|
ADD CONSTRAINT `player_storage_ibfk_1` FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE;
|
|
|
|
--
|
|
-- Constraints for table `tile_store`
|
|
--
|
|
ALTER TABLE `tile_store`
|
|
ADD CONSTRAINT `tile_store_ibfk_1` FOREIGN KEY (`house_id`) REFERENCES `houses` (`id`) ON DELETE CASCADE;
|