diff options
author | Kitzunu <24550914+Kitzunu@users.noreply.github.com> | 2025-02-01 16:48:24 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-02-01 16:48:24 +0100 |
commit | 137337601d92070a0aecfc2ccd9b2b9d99f4af0d (patch) | |
tree | d8534b3c79434f2b7281446202d234734b35e347 /apps | |
parent | 5e7d4bd9d7a6c3c02c80f8f1e2a17fedb8b6fe7b (diff) |
fix(DB/Misc): Bad delete in update file (#21307)
Co-authored-by: Andrew <47818697+Nyeriah@users.noreply.github.com>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/codestyle/codestyle-sql.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/apps/codestyle/codestyle-sql.py b/apps/codestyle/codestyle-sql.py index 0df5dec05b..e8f67efd13 100644 --- a/apps/codestyle/codestyle-sql.py +++ b/apps/codestyle/codestyle-sql.py @@ -102,10 +102,16 @@ def trailing_whitespace_check(file: io, file_path: str) -> None: def sql_check(file: io, file_path: str) -> None: global error_handler, results file.seek(0) # Reset file pointer to the beginning + not_delete = ["creature_template", "gameobject_template", "item_template", "quest_template"] check_failed = False # Parse all the file for line_number, line in enumerate(file, start = 1): + for table in not_delete: + if f"DELETE FROM `{table}`" in line: + print( + f"Entries from this {table} should not be deleted! {file_path} at line {line_number}") + check_failed = True if [match for match in ['broadcast_text'] if match in line]: print( f"DON'T EDIT broadcast_text TABLE UNLESS YOU KNOW WHAT YOU ARE DOING!\nThis error can safely be ignored if the changes are approved to be sniffed: {file_path} at line {line_number}") |