dbmodel.sql not running?

Game development with Board Game Arena Studio
Post Reply
User avatar
PurplishCat
Posts: 11
Joined: 29 November 2016, 05:02

dbmodel.sql not running?

Post by PurplishCat »

Working through Reversi tutorial, it appears the dbmodel.sql is not being run.

I have put the create table sql into dbmodel.sql, but it appears to not be executed when I launch a new game, as when I try and insert data into the table I get a sql error that the table doesn't exist (again, new games launched after the dbmodel.sql change). Looking at logs (https://studio.boardgamearena.com/admin/studio, as instructed on dbmodel.sql doc page), I don't see any errors or attempts related to creating the table. I have also tried intentionally invalid sql just to get an error, but I don't see one. Any pointers for what else I can look at?

Bonus question: When I Express Start a game, ALL my open tabs anywhere in studio.bga switch to the game, including tabs that were on tutorial or docs pages. A bit frustrating. Is this normal?

Thanks!
User avatar
quietmint
Posts: 299
Joined: 31 July 2017, 00:28

Re: dbmodel.sql not running?

Post by quietmint »

Try looking in phpMyAdmin to see what the database actually looks like. While you're playing the game, there's a button under the play area to "go to game database", or you can just go here https://db.1.studio.boardgamearena.com/ and login using the same credentials for SFTP. Do you see the tables/columns you expect in phpMyAdmin? If not, then double check the syntax of dbmodel.sql and make sure you've properly saved and uploaded the file via SFTP.
User avatar
PurplishCat
Posts: 11
Joined: 29 November 2016, 05:02

Re: dbmodel.sql not running?

Post by PurplishCat »

Was missing semicolon at the end. :oops:

But for such a problem where can I find any clues? I couldn't find anything related to create table in the logs (errors or attempts).

And is it normal for all browser tabs in studio.bga to join the game when one tab does?

Thanks.
User avatar
quietmint
Posts: 299
Joined: 31 July 2017, 00:28

Re: dbmodel.sql not running?

Post by quietmint »

PurplishCat wrote: 07 September 2020, 06:20 And is it normal for all browser tabs in studio.bga to join the game when one tab does?
Unfortunately yes. The same bug exists in BGA main site, too!

In studio I found creating a turn based game works a bit better because it doesn't automatically go to the game screen when you click "express start". Then it's not really a problem other than the annoying browser/tab title bar.
User avatar
Een
Posts: 3861
Joined: 16 June 2010, 19:52

Re: dbmodel.sql not running?

Post by Een »

PurplishCat wrote: 07 September 2020, 06:20 Was missing semicolon at the end. :oops:

But for such a problem where can I find any clues? I couldn't find anything related to create table in the logs (errors or attempts).
This code is run at game creation, so it's triggered by a server, not a user. As such, logs are not linked to a user, so we can't put it directly in your developer logs, it's in general logging. In principle it would be good to find a way to move this in the developer logs, but at the moment we haven't a good way to do so.
User avatar
Een
Posts: 3861
Joined: 16 June 2010, 19:52

Re: dbmodel.sql not running?

Post by Een »

quietmint wrote: 07 September 2020, 14:07
PurplishCat wrote: 07 September 2020, 06:20 And is it normal for all browser tabs in studio.bga to join the game when one tab does?
Unfortunately yes. The same bug exists in BGA main site, too!
That's the intended behaviour. It can be seen as good or bad (that's a matter of opinion), but it's not a bug.
quietmint wrote: 07 September 2020, 14:07 In studio I found creating a turn based game works a bit better because it doesn't automatically go to the game screen when you click "express start". Then it's not really a problem other than the annoying browser/tab title bar.
I also favor starting games in turn based mode on the studio.
Post Reply

Return to “Developers”