qb-core icon indicating copy to clipboard operation
qb-core copied to clipboard

Updated player deletion code to accommodate tables that do not use the column name citizenid

Open tlsharkie opened this issue 8 months ago • 2 comments

Updated player deletion code in server/player.lua to accommodate tables that do not use the column name citizenid. Many scripts use other column names to store the citizenid but contain data that should be deleted upon character deletion. This leads to excess data build up in the database that is no longer needed and currently requires manual effort to clean out the database.

New format for playertables now contains table and key variables (primary key column name) and updated SQL commands in DeleteCharacter and ForceDeleteCharacter to handle variable column names

--- 'table' is the new SQL table name
--- 'key' is the column name which contains the 'citizenid'
{ table = 'players', key = 'citizenid' } 

Checklist

  • [x] I have personally loaded this code into an updated qbcore project and checked all of its functionality.
  • [x] My code fits the style guidelines.
  • [x] My PR fits the contribution guidelines.

tlsharkie avatar Mar 15 '25 06:03 tlsharkie

This PR has had 60 days of inactivity & will close within 7 days

github-actions[bot] avatar May 14 '25 15:05 github-actions[bot]

updated code and removed trailing whitespaces to pass lint tests

tlsharkie avatar May 14 '25 18:05 tlsharkie

This includes tables that do not exist in qbcore

GhzGarage avatar Jun 22 '25 20:06 GhzGarage

This PR has had 60 days of inactivity & will close within 7 days

github-actions[bot] avatar Oct 01 '25 15:10 github-actions[bot]

Sorry for the delay on this one. Removed non-QBCore tables from the player deletion code. Left a comment section at the bottom of QBCore tables with the format for adding addtional tables.

tlsharkie avatar Oct 01 '25 21:10 tlsharkie