Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

tlsharkie
Copy link

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

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

Updated `Delete character` code to handle database tables where primary key is not `citizenid`

Changed `playertables` format to handle any primary key

Updated `DeleteCharater()` and `ForceDeleteCharater()` SQL commands
…e column name citizenid

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant