Page 1 of 1

new table in DB

Posted: 02 June 2020, 09:38
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 ?

Re: new table in DB

Posted: 02 June 2020, 10:45
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

Re: new table in DB

Posted: 02 June 2020, 11:05
by tchobello
I'm trying to add a table for games already launched...

Re: new table in DB

Posted: 02 June 2020, 12:24
by Galeelox
Nothing wrong in your code.
Did you try to read your 'BGA request&SQL logs'?

Re: new table in DB

Posted: 02 June 2020, 12:58
by vincentt
Hi

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

vincent

Re: new table in DB

Posted: 02 June 2020, 13:19
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.