Skip to content

Commit

Permalink
fix: order
Browse files Browse the repository at this point in the history
  • Loading branch information
dudantas committed Dec 9, 2024
1 parent 0721e4b commit ce08db0
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
24 changes: 3 additions & 21 deletions data-otservbr-global/migrations/46.lua
Original file line number Diff line number Diff line change
@@ -1,24 +1,6 @@
function onUpdateDatabase()
logger.info("Updating database to version 46 (hireling)")
logger.info("Updating database to version 47 (fix: creature speed and conditions)")

db.query([[
CREATE TABLE IF NOT EXISTS `player_hirelings` (
`id` INT NOT NULL PRIMARY KEY auto_increment,
`player_id` INT NOT NULL,
`name` varchar(255),
`active` tinyint unsigned NOT NULL DEFAULT '0',
`sex` tinyint unsigned 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',
`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',
FOREIGN KEY(`player_id`) REFERENCES `players`(`id`)
ON DELETE CASCADE
)
]])
db.query("ALTER TABLE `players` MODIFY `conditions` mediumblob NOT NULL;")
end

24 changes: 21 additions & 3 deletions data-otservbr-global/migrations/47.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
function onUpdateDatabase()
logger.info("Updating database to version 47 (fix: creature speed and conditions)")
logger.info("Updating database to version 46 (hireling)")

db.query("ALTER TABLE `players` MODIFY `conditions` mediumblob NOT NULL;")
end
db.query([[
CREATE TABLE IF NOT EXISTS `player_hirelings` (
`id` INT NOT NULL PRIMARY KEY auto_increment,
`player_id` INT NOT NULL,
`name` varchar(255),
`active` tinyint unsigned NOT NULL DEFAULT '0',
`sex` tinyint unsigned 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',
`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',
FOREIGN KEY(`player_id`) REFERENCES `players`(`id`)
ON DELETE CASCADE
)
]])
end

0 comments on commit ce08db0

Please sign in to comment.