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 ecc176caf2
commit dffdef6728
No known key found for this signature in database

View file

@ -63,7 +63,7 @@ template<typename O>
project->db->query_one<bool>("SELECT EXISTS(SELECT 1 FROM `blueprints` WHERE `name` = ?)", name)
);
return exists;
return !exists;
}
[[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)
);
return exists;
return !exists;
}
[[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())
);
return exists;
return !exists;
}
[[nodiscard]] inline bool