ALTER TABLE 'player'

Game development with Board Game Arena Studio
Post Reply
User avatar
Oermelie
Posts: 4
Joined: 22 July 2022, 07:00

ALTER TABLE 'player'

Post by Oermelie »

Hi everybody,

evertime I use the ALTER TABLE 'player' to add some custom fields to the table.

ALTER TABLE `player` ADD `beer` INT UNSIGNED NOT NULL DEFAULT '0';

my game doesnt start with some kind of error:

Unexpected error: Propagating error from gameserver 1 (method: createGame): BGA service error (reference: GS1 27/07 17:47:57) (reference: GS0 27/07 17:47:57)

After that the only way to start the game is to "Overwrite working copy with this revision"
User avatar
RicardoRix
Posts: 2112
Joined: 29 April 2012, 23:43

Re: ALTER TABLE 'player'

Post by RicardoRix »

I just added that line to my game, and it works fine.

file: dbmodel.sql

You can comment out a line with the double dash. You don't need to restore the last version.
So maybe there is something else you have broken.

Code: Select all

--ALTER TABLE `player` ADD `beer` INT UNSIGNED NOT NULL DEFAULT '0';
User avatar
Oermelie
Posts: 4
Joined: 22 July 2022, 07:00

Re: ALTER TABLE 'player'

Post by Oermelie »

my game is fully working until I comment out this line
User avatar
RicardoRix
Posts: 2112
Joined: 29 April 2012, 23:43

Re: ALTER TABLE 'player'

Post by RicardoRix »

start from a place where your code works and the game starts.

Then make changes. When it doesn't work anymore you've inadvertently broken something. The dbmodel.sql is only used when you start a new game and the DB is created.
User avatar
Tisaac
Posts: 2350
Joined: 26 August 2014, 21:28

Re: ALTER TABLE 'player'

Post by Tisaac »

Oermelie wrote: 28 July 2022, 08:30 my game is fully working until I comment out this line
You very likely just forgot to change the INSERT statement with that extra field.
toddcarson
Posts: 8
Joined: 09 February 2023, 10:25

Re: ALTER TABLE 'player'

Post by toddcarson »

Afterwards, make the necessary edits. You broke it by accident the last time it stopped working. The dbmodel.sql file is used when you start a new game and create the database. geometry dash
User avatar
snugglecactus
Posts: 7
Joined: 16 August 2023, 07:06

Re: ALTER TABLE 'player'

Post by snugglecactus »

Tisaac wrote: 30 July 2022, 17:13
Oermelie wrote: 28 July 2022, 08:30 my game is fully working until I comment out this line
You very likely just forgot to change the INSERT statement with that extra field.
Shouldn't be a problem with the `DEFAULT` clause there.
Post Reply

Return to “Developers”