invert condition for whether name is unique

Signed-off-by: Folling <mail@folling.io>
This commit is contained in:
folling 2024-02-12 15:36:44 +01:00 committed by Folling
parent 53eea695e1
commit 8364d42c3e
Signed by: folling
SSH key fingerprint: SHA256:S9qEx5WCFFLK49tE/LKnKuJYM5sw+++Dn6qJbbyxnCY

View file

@ -63,7 +63,7 @@ template<typename O>
project->db->query_one<bool>("SELECT EXISTS(SELECT 1 FROM `blueprints` WHERE `name` = ?)", name) project->db->query_one<bool>("SELECT EXISTS(SELECT 1 FROM `blueprints` WHERE `name` = ?)", name)
); );
return exists; return !exists;
} }
[[nodiscard]] inline bool name_is_unique( [[nodiscard]] inline bool name_is_unique(
@ -80,7 +80,7 @@ template<typename O>
project->db->query_one<bool>("SELECT EXISTS(SELECT 1 FROM `entities` WHERE `name` = ?)", name) project->db->query_one<bool>("SELECT EXISTS(SELECT 1 FROM `entities` WHERE `name` = ?)", name)
); );
return exists; return !exists;
} }
[[nodiscard]] inline bool [[nodiscard]] inline bool
@ -93,7 +93,7 @@ name_is_unique(IkarusProject const * project, std::string_view name, IkarusPrope
project->db->query_one<bool>("SELECT EXISTS(SELECT 1 FROM `properties` WHERE `name` = ? AND `scope` = ?)", name, scope->get_id()) project->db->query_one<bool>("SELECT EXISTS(SELECT 1 FROM `properties` WHERE `name` = ? AND `scope` = ?)", name, scope->get_id())
); );
return exists; return !exists;
} }
[[nodiscard]] inline bool [[nodiscard]] inline bool