Page 1 of 1

upgradeTableDb

Posted: 05 July 2020, 16:02
by Lunalol
Hi. Can upgradeTableDb could be used to just upgrade DB content, not DB structure ?

if ($from_version <= '2007040042')
{
self::applyDbUpgradeToAllDB("UPDATE DBPREFIX_markers SET location = 'weather_cold_0' WHERE location = 'cold_0'");
}

I just wanted to change the name of the location of some markers (''cold_0' is an ID of HTML element, it's new name is 'weather_cold_0')
My upgradeTableDb does nothing, why ?

Thansk for help.
(I'm on alpha phase)

Re: upgradeTableDb

Posted: 05 July 2020, 16:54
by Een
Hi, it seems good to me and should work if you used the proper from_version. A procedure to test your upgradeTableDb on the studio has recently been added, so you can use that to check it out: http://en.doc.boardgamearena.com/Post-r ... ase_schema

Re: upgradeTableDb

Posted: 05 July 2020, 19:03
by Lunalol
Hi again.

My production version is : Version 200704-0042 (Current PRODUCTION version)
So it should works but it no.

($from_version <= '2007040042' should we use a string or an integer, or perhaps it's the same ?)

DB update is not done, so I have a JS error because I want to place a marker on 'cold_0' element and it don't exist anymore (renamed 'weather_cold_0')

UPDATE : It's work for 2/3 table, I change to $from_version <= '9999999999' it works for all. So probably one table was already badly updated (DB update not commited but version number upgraded).