BAndysc / BAndysc/WoWDatabaseEditor

Optimize DELETE statement for phase_area conditions

Open
#227 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
C#
Stars
564
Forks
169
PR merge metrics
No merged PRs in 30d

Description

**Is your feature request related to a problem? Please describe.**
When generating `phase_area` entry the output looks like the following sql query:
```sql
DELETE FROM `conditions` WHERE (`SourceTypeOrReferenceId` = 26) AND (`SourceEntry` IN (9042));
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `ConditionStringValue1`, `NegativeCondition`, `Comment`) VALUES
(26, 12812, 9042, 0, 0, 9, 0, 54721, 0, 0, '', 1, 'Player doesn\'t have quest I\'m Too Old for This Ship (54721) active');
```
What happens here: We are deleting ALL phase conditions for Area/ZoneId 9042 here.

**Describe the solution you'd like**
DELETE by SourceTypeOrReferenceId AND SourceGroup AND SourceEntry

Contributor guide

No contributing guide indexed for this repository

Research direction

The issue shows the generated DELETE statement for phase_area conditions; start by locating the SQL generation path that produces this statement and inspect how SourceTypeOrReferenceId, SourceGroup, and SourceEntry are selected. Verify the generated SQL restricts all three fields and preserves the existing INSERT output.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, sql
Domain
database, tooling
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.