Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
luanluciano93 committed May 31, 2024
2 parents 056995c + 6fed176 commit 1893870
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 37 deletions.
10 changes: 5 additions & 5 deletions data-otservbr-global/migrations/45.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ function onUpdateDatabase()

db.query([[
CREATE TABLE IF NOT EXISTS `account_vipgroups` (
`id` tinyint(3) UNSIGNED NOT NULL,
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`account_id` int(11) UNSIGNED NOT NULL COMMENT 'id of account whose vip group entry it is',
`name` varchar(128) NOT NULL,
`customizable` BOOLEAN NOT NULL DEFAULT '1',
Expand All @@ -13,17 +13,17 @@ function onUpdateDatabase()

db.query([[
CREATE TRIGGER `oncreate_accounts` AFTER INSERT ON `accounts` FOR EACH ROW BEGIN
INSERT INTO `account_vipgroups` (`id`, `account_id`, `name`, `customizable`) VALUES (1, NEW.`id`, 'Enemies', 0);
INSERT INTO `account_vipgroups` (`id`, `account_id`, `name`, `customizable`) VALUES (2, NEW.`id`, 'Friends', 0);
INSERT INTO `account_vipgroups` (`id`, `account_id`, `name`, `customizable`) VALUES (3, NEW.`id`, 'Trading Partner', 0);
INSERT INTO `account_vipgroups` (`account_id`, `name`, `customizable`) VALUES (NEW.`id`, 'Enemies', 0);
INSERT INTO `account_vipgroups` (`account_id`, `name`, `customizable`) VALUES (NEW.`id`, 'Friends', 0);
INSERT INTO `account_vipgroups` (`account_id`, `name`, `customizable`) VALUES (NEW.`id`, 'Trading Partner', 0);
END;
]])

db.query([[
CREATE TABLE IF NOT EXISTS `account_vipgrouplist` (
`account_id` int(11) UNSIGNED 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',
`vipgroup_id` tinyint(3) UNSIGNED NOT NULL COMMENT 'id of vip group that player belongs',
`vipgroup_id` int(11) UNSIGNED NOT NULL COMMENT 'id of vip group that player belongs',
INDEX `account_id` (`account_id`),
INDEX `player_id` (`player_id`),
INDEX `vipgroup_id` (`vipgroup_id`),
Expand Down
62 changes: 30 additions & 32 deletions schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ CREATE TABLE IF NOT EXISTS `account_viplist` (

-- Table structure `account_vipgroup`
CREATE TABLE IF NOT EXISTS `account_vipgroups` (
`id` tinyint(3) UNSIGNED NOT NULL,
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`account_id` int(11) UNSIGNED NOT NULL COMMENT 'id of account whose vip group entry it is',
`name` varchar(128) NOT NULL,
`customizable` BOOLEAN NOT NULL DEFAULT '1',
Expand All @@ -229,9 +229,9 @@ CREATE TABLE IF NOT EXISTS `account_vipgroups` (
--
DELIMITER //
CREATE TRIGGER `oncreate_accounts` AFTER INSERT ON `accounts` FOR EACH ROW BEGIN
INSERT INTO `account_vipgroups` (`id`, `account_id`, `name`, `customizable`) VALUES (1, NEW.`id`, 'Enemies', 0);
INSERT INTO `account_vipgroups` (`id`, `account_id`, `name`, `customizable`) VALUES (2, NEW.`id`, 'Friends', 0);
INSERT INTO `account_vipgroups` (`id`, `account_id`, `name`, `customizable`) VALUES (3, NEW.`id`, 'Trading Partner', 0);
INSERT INTO `account_vipgroups` (`account_id`, `name`, `customizable`) VALUES (NEW.`id`, 'Enemies', 0);
INSERT INTO `account_vipgroups` (`account_id`, `name`, `customizable`) VALUES (NEW.`id`, 'Friends', 0);
INSERT INTO `account_vipgroups` (`account_id`, `name`, `customizable`) VALUES (NEW.`id`, 'Trading Partner', 0);
END
//
DELIMITER ;
Expand All @@ -240,7 +240,7 @@ DELIMITER ;
CREATE TABLE IF NOT EXISTS `account_vipgrouplist` (
`account_id` int(11) UNSIGNED 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',
`vipgroup_id` tinyint(3) UNSIGNED NOT NULL COMMENT 'id of vip group that player belongs',
`vipgroup_id` int(11) UNSIGNED NOT NULL COMMENT 'id of vip group that player belongs',
INDEX `account_id` (`account_id`),
INDEX `player_id` (`player_id`),
INDEX `vipgroup_id` (`vipgroup_id`),
Expand All @@ -258,35 +258,36 @@ CREATE TABLE IF NOT EXISTS `boosted_boss` (
`boostname` TEXT,
`date` varchar(250) NOT NULL DEFAULT '',
`raceid` varchar(250) NOT NULL DEFAULT '',
`looktypeEx` int(11) NOT NULL DEFAULT "0",
`looktype` int(11) NOT NULL DEFAULT "136",
`lookfeet` int(11) NOT NULL DEFAULT "0",
`looklegs` int(11) NOT NULL DEFAULT "0",
`lookhead` int(11) NOT NULL DEFAULT "0",
`lookbody` int(11) NOT NULL DEFAULT "0",
`lookaddons` int(11) NOT NULL DEFAULT "0",
`lookmount` int(11) DEFAULT "0",
`looktypeEx` int(11) NOT NULL DEFAULT 0,
`looktype` int(11) NOT NULL DEFAULT 136,
`lookfeet` int(11) NOT NULL DEFAULT 0,
`looklegs` int(11) NOT NULL DEFAULT 0,
`lookhead` int(11) NOT NULL DEFAULT 0,
`lookbody` int(11) NOT NULL DEFAULT 0,
`lookaddons` int(11) NOT NULL DEFAULT 0,
`lookmount` int(11) DEFAULT 0,
PRIMARY KEY (`date`)
) AS SELECT 0 AS date, "default" AS boostname, 0 AS raceid;
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

INSERT INTO `boosted_boss` (`boostname`, `date`, `raceid`) VALUES ('default', 0, 0);

-- Table structure `boosted_creature`
CREATE TABLE IF NOT EXISTS `boosted_creature` (
`boostname` TEXT,
`date` varchar(250) NOT NULL DEFAULT '',
`raceid` varchar(250) NOT NULL DEFAULT '',
`looktype` int(11) NOT NULL DEFAULT "136",
`lookfeet` int(11) NOT NULL DEFAULT "0",
`looklegs` int(11) NOT NULL DEFAULT "0",
`lookhead` int(11) NOT NULL DEFAULT "0",
`lookbody` int(11) NOT NULL DEFAULT "0",
`lookaddons` int(11) NOT NULL DEFAULT "0",
`lookmount` int(11) DEFAULT "0",
`looktype` int(11) NOT NULL DEFAULT 136,
`lookfeet` int(11) NOT NULL DEFAULT 0,
`looklegs` int(11) NOT NULL DEFAULT 0,
`lookhead` int(11) NOT NULL DEFAULT 0,
`lookbody` int(11) NOT NULL DEFAULT 0,
`lookaddons` int(11) NOT NULL DEFAULT 0,
`lookmount` int(11) DEFAULT 0,
PRIMARY KEY (`date`)
) AS SELECT 0 AS date, "default" AS boostname, 0 AS raceid;
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------
INSERT INTO `boosted_creature` (`boostname`, `date`, `raceid`) VALUES ('default', 0, 0);

--
-- Tabble Structure `daily_reward_history`
CREATE TABLE IF NOT EXISTS `daily_reward_history` (
`id` int(11) NOT NULL AUTO_INCREMENT,
Expand Down Expand Up @@ -473,7 +474,6 @@ END
DELIMITER ;

-- Table structure `house_lists`

CREATE TABLE IF NOT EXISTS `house_lists` (
`house_id` int NOT NULL,
`listid` int NOT NULL,
Expand All @@ -485,7 +485,6 @@ CREATE TABLE IF NOT EXISTS `house_lists` (
CONSTRAINT `houses_list_house_fk` FOREIGN KEY (`house_id`) REFERENCES `houses` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;


-- Table structure `ip_bans`
CREATE TABLE IF NOT EXISTS `ip_bans` (
`ip` int(11) NOT NULL,
Expand Down Expand Up @@ -540,7 +539,6 @@ CREATE TABLE IF NOT EXISTS `market_offers` (
ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


-- Table structure `players_online`
CREATE TABLE IF NOT EXISTS `players_online` (
`player_id` int(11) NOT NULL,
Expand Down Expand Up @@ -671,7 +669,6 @@ CREATE TABLE IF NOT EXISTS `player_wheeldata` (
PRIMARY KEY (`player_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


-- Table structure `player_kills`
CREATE TABLE IF NOT EXISTS `player_kills` (
`player_id` int(11) NOT NULL,
Expand Down Expand Up @@ -830,6 +827,7 @@ CREATE TABLE IF NOT EXISTS `account_sessions` (
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- Table structure `kv_store`
CREATE TABLE IF NOT EXISTS `kv_store` (
`key_name` varchar(191) NOT NULL,
`timestamp` bigint NOT NULL,
Expand All @@ -854,7 +852,7 @@ INSERT INTO `players`
(6, 'GOD', 6, 1, 2, 0, 155, 155, 100, 113, 115, 95, 39, 75, 0, 60, 60, 0, 8, '', 410, 1, 10, 0, 10, 0, 10, 0, 10, 0);

-- Create vip groups for GOD account
INSERT INTO `account_vipgroups` (`id`, `name`, `account_id`, `customizable`) VALUES
(1, 'Friends', 1, 0),
(2, 'Enemies', 1, 0),
(3, 'Trading Partners', 1, 0);
INSERT INTO `account_vipgroups` (`name`, `account_id`, `customizable`) VALUES
('Friends', 1, 0),
('Enemies', 1, 0),
('Trading Partners', 1, 0);

0 comments on commit 1893870

Please sign in to comment.