Page 1 of 1

PyPlanet bug local record

Posted: 20 Nov 2018, 03:47
by benj9029
Hi
I got a problem with PyPlanet, when I use the Local Record app the console just crash and same with mania karma but don't really care of this one,
The error :
INFO [Main][pyplanet.core.management.commands.start] Initiated configuration and environment...
INFO [Main][pyplanet.core.management.commands.start] -------------------------------[ PyPlanet v0.6.3 ]-------------------------------
INFO [MainThread][pyplanet.god.process] Starting pool process for 'default'...
INFO [default][root] Database connection established!
WARNING [default][pyplanet.core.db.migrator] Can't migrate pyplanet.apps.contrib.local_records.migrations.000_make_player_map_unique: (1061, "Nom de clef 'localrecord_player_id_map_id' déjà utilisé")
ERROR [default][pyplanet.core.instance] (1061, "Nom de clef 'localrecord_player_id_map_id' déjà utilisé")

"déja utilisé" mean already used
Does anyone get an idea?
Thanks

Re: PyPlanet bug local record

Posted: 20 Nov 2018, 12:19
by toffe
Hi,

You have duplicates in the maps table that needs to be removed first. You can do so with the following database query (execute it with MySQL CLI or PHPMyAdmin on the right database).

Code: Select all

DELETE l1 FROM localrecord l1
        INNER JOIN
    localrecord l2 
WHERE
    l1.id < l2.id AND l1.map_id = l2.map_id;
After executing this query, try to restart PyPlanet and the migration will succeed.

Re: PyPlanet bug local record

Posted: 21 Nov 2018, 00:08
by benj9029
Where do I need to type that because I entered this in the database and that doesn't work, do I need to execute it in a special place ?

Re: PyPlanet bug local record

Posted: 21 Nov 2018, 00:18
by benj9029
Nvm, I deleted all the index of local record and that just worked :)