azerothcore / Keira3

Cross-platform Database Editor for AzerothCore
https://www.azerothcore.org/Keira3
GNU Affero General Public License v3.0
343 stars 141 forks source link

SQL Standards for Flags and Bits #1318

Open ghost opened 3 years ago

ghost commented 3 years ago

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).
Helias commented 3 years ago

yep, we need to do this

Azcobu commented 3 years ago

Been caught by this as well, definitely support this idea.

Kitzunu commented 2 years ago

Any eta on this https://www.azerothcore.org/wiki/sql-standards#flags-amp-bits

much safer way of dealing with flags

FrancescoBorzi commented 2 years ago

no ETA because I'm very busy, if someone wants to help and implement it would be welcome of course

FrancescoBorzi commented 2 years ago

@claudiodfc why closing?