renamed constraint to restriction

This commit is contained in:
Sascha Kühl
2025-12-09 14:53:29 +01:00
parent 4fcbe9c064
commit c4f8731262
23 changed files with 79 additions and 74 deletions
+3 -3
View File
@@ -14,7 +14,7 @@ void object_generator::on_revision(const char* id, uint64_t& rev) {
}
void object_generator::create_pk_constraint(const std::string& name) const {
class constraint pk_constraint("PK_" + object_->name());
class restriction pk_constraint("PK_" + object_->name());
pk_constraint.options_ |= utils::constraints::PrimaryKey;
if (const auto pk_attr = find_attribute_by_name(name); pk_attr != std::end(object_->attributes_)) {
pk_constraint.attr_ = &*pk_attr;
@@ -26,7 +26,7 @@ void object_generator::create_pk_constraint(const std::string& name) const {
void object_generator::create_fk_constraint(const std::type_index& ti, const std::string& name) const {
const auto obj = fk_object(ti);
const auto *pk_attribute = obj->primary_key_attribute();
class constraint pk_constraint("FK_" + object_->name() + "_" + name);
class restriction pk_constraint("FK_" + object_->name() + "_" + name);
pk_constraint.options_ |= utils::constraints::ForeignKey;
if (const auto pk_attr = find_attribute_by_name(name); pk_attr != std::end(object_->attributes_)) {
pk_constraint.attr_ = &*pk_attr;
@@ -41,7 +41,7 @@ void object_generator::create_fk_constraint(const std::type_index& ti, const std
}
void object_generator::create_unique_constraint(const std::string& name) const {
class constraint pk_constraint("UK_" + object_->name() + "_" + name);
class restriction pk_constraint("UK_" + object_->name() + "_" + name);
pk_constraint.options_ |= utils::constraints::Unique;
if (const auto pk_attr = find_attribute_by_name(name); pk_attr != std::end(object_->attributes_)) {
pk_constraint.attr_ = &*pk_attr;