Skip to content

Commit

Permalink
fix: add migrations to create "towns" table (opentibiabr#859)
Browse files Browse the repository at this point in the history
Complement of: opentibiabr@abdf22f
  • Loading branch information
dudantas authored Feb 13, 2023
1 parent 8a1046a commit 5aa0b55
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
14 changes: 13 additions & 1 deletion data-otservbr-global/migrations/26.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
function onUpdateDatabase()
return false -- true = There are others migrations file | false = this is the last migration file
Spdlog.info("Updating database to version 27 (towns)")

db.query([[
CREATE TABLE IF NOT EXISTS `towns` (
`id` int NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`posx` int NOT NULL DEFAULT '0',
`posy` int NOT NULL DEFAULT '0',
`posz` int NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`))
]])
return true
end
3 changes: 3 additions & 0 deletions data-otservbr-global/migrations/27.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
function onUpdateDatabase()
return false -- true = There are others migrations file | false = this is the last migration file
end

0 comments on commit 5aa0b55

Please sign in to comment.