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 4 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.
Copy link

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

@github-actions github-actions bot added the Stale label May 14, 2025
Copy link
Author

@tlsharkie tlsharkie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed trailing whitespaces

Copy link
Author

@tlsharkie tlsharkie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed trailing whitespaces from functions.lua to pass lint tests

tlsharkie added 2 commits May 14, 2025 10:59
Removed trailing whitespace to pass lint tests
@tlsharkie
Copy link
Author

updated code and removed trailing whitespaces to pass lint tests

@github-actions github-actions bot removed the Stale label May 15, 2025
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