FPtje / DarkRP

DarkRP, a non-serious roleplay gamemode for Garry's Mod.
https://darkrp.miraheze.org
MIT License
463 stars 710 forks source link

Table 'TempJobCommands' already exists #1659

Closed Offgreenstum closed 10 years ago

Offgreenstum commented 10 years ago

Lua Error: Table 'TempJobCommands' already exists (CREATE TABLE TempJobCommands(id INT NOT NULL PRIMARY KEY, cmd VARCHAR(255) NOT NULL);)

This started a month after our server switched to mysql. It resets all jail positions and door groups on restart. The error is only shown when the server is starting up, and I've attempted disabling every other addon and still get the same result.

fruitwasp commented 10 years ago

Line: https://github.com/FPtje/DarkRP/blob/master/gamemode/modules/base/sv_data.lua#L186

Fix: Type the following code in your server-side console:

lua_run MySQLite.queueQuery("DROP TABLE TempJobCommands;")

Restart your server after.

Cause: The error is caused by the table not being dropped from the database for an unknown reason. It should drop.

Bo98 commented 10 years ago

A check should be added to DarkRP for these rare cases.

FPtje commented 10 years ago

Yes

FPtje commented 10 years ago

Though this really shouldn't be happening, and he'll probably come back with another error that occurs during the migrating progress.

FPtje commented 10 years ago

I was right: #1661

Shigbeard commented 10 years ago

Shouldn't the query use CREATE TABLE IF NOT EXISTS ? On 8/10/2014 1:49 AM, Bo Anderson wrote:

A check should be added to DarkRP for these rare cases.

— Reply to this email directly or view it on GitHub https://github.com/FPtje/DarkRP/issues/1659#issuecomment-58196572.

FPtje commented 10 years ago

Isn't that already happening in the update?