new table in DB

Game development with Board Game Arena Studio
Post Reply
User avatar
tchobello
Posts: 694
Joined: 18 March 2012, 13:19

new table in DB

Post by tchobello »

Hi i've added a new table in DB & I have this message :
Désolé, une erreur inattendue s'est produite...
Error while processing Database request (2.boardgamearena.com 02/06 10:34:20)

i've added this in DB MODEL

Code: Select all

CREATE TABLE `moves` (
  `id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
  `x` mediumint(9) NOT NULL,
  `y` mediumint(9) NOT NULL,
   PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

and this in GAME.PHP

Code: Select all

       if( $from_version <= 2006020000 )
        {
            $sql = "CREATE TABLE IF NOT EXISTS DBPREFIX_moves (
                id smallint(5) unsigned NOT NULL AUTO_INCREMENT,
                x mediumint(9) NOT NULL,
  `             y mediumint(9) NOT NULL,
                PRIMARY KEY (id)
                ) ENGINE=InnoDB DEFAULT CHARSET=latin1";
            self::applyDbUpgradeToAllDB( $sql );
		}
Did I write anything wrong ?
User avatar
Galeelox
Posts: 17
Joined: 14 March 2017, 12:17

Re: new table in DB

Post by Galeelox »

Hello!
Sorry but I don't understand why you create your table a second time in game.php while you're already created it in the database model.
Regards,
David
User avatar
tchobello
Posts: 694
Joined: 18 March 2012, 13:19

Re: new table in DB

Post by tchobello »

I'm trying to add a table for games already launched...
User avatar
Galeelox
Posts: 17
Joined: 14 March 2017, 12:17

Re: new table in DB

Post by Galeelox »

Nothing wrong in your code.
Did you try to read your 'BGA request&SQL logs'?
vincentt
Posts: 254
Joined: 01 September 2017, 17:25

Re: new table in DB

Post by vincentt »

Hi

If I remember correctly, the updatedb is not triggered on the studio.
When does this error happens? At game creation?

vincent
User avatar
tchobello
Posts: 694
Joined: 18 March 2012, 13:19

Re: new table in DB

Post by tchobello »

vincentt wrote: 02 June 2020, 12:58 Hi

If I remember correctly, the updatedb is not triggered on the studio.
When does this error happens? At game creation?

vincent
I want to add a table on games already created, as explained in the post release phase

I've tried using 9999999999 in the Studio. and the code above in production.
both have failed.
Post Reply

Return to “Developers”