azerothcore / azerothcore/Keira3

SQL Standards for Flags and Bits

Open
#1,318 5 comments 4 reactions 0 assignees View on GitHub
feature request
Dominant language
TypeScript
Stars
450
Forks
183
Avg merge
23h 42m
Merged PRs (30d)
18

Description

When I was changing `creature_template` the query was not in sync with the SQL standards implemented. Would be nice to get the job done using Keira instead of manually changing the query 😀

### Wrong example:
```
UPDATE `creature_template` SET `mechanic_immune_mask` = 617299803 WHERE `entry` = 7727;
```

### Good example:
```
-- Adding flags
UPDATE `creature_template` SET `mechanic_immune_mask`=`mechanic_immune_mask`|64|256|1024 WHERE `entry` = 7727;

-- Removing flags
UPDATE `creature_template` SET `mechanic_immune_mask`=`mechanic_immune_mask`&~(64|256|1024) WHERE `entry` = 7727;
```

Link: https://www.azerothcore.org/wiki/sql-standards#flags-amp-bits

---
Want to back this issue? **[Post a bounty on it!](https://app.bountysource.com/issues/99383440-sql-standards-for-flags-and-bits?utm_campaign=plugin&utm_content=tracker%2F139701226&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://app.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F139701226&utm_medium=issues&utm_source=github).

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reviewing the linked SQL standards section on flags and bits and the creature_template examples in the issue. Then trace the relevant Keira editing flow; done should allow flag additions and removals to follow the shown SQL standard instead of relying on a manually entered combined value.

Written by the indexing model from the issue text.

Assessment

Tech stack
sql, typescript
Domain
database, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.