removed attribute_generator and constraints_generator

This commit is contained in:
Sascha Kühl
2025-12-11 09:13:14 +01:00
parent 5afb616205
commit f842efb611
14 changed files with 13 additions and 400 deletions
+7 -7
View File
@@ -8,7 +8,7 @@ restriction::restriction(std::string name)
: name_(std::move(name)) {}
std::string restriction::name() const {
return prefix() + name_;
return type_string() + name_;
}
const class attribute* restriction::attribute() const {
@@ -55,21 +55,21 @@ const std::string& restriction::ref_column_name() const {
}
std::ostream & operator<<(std::ostream &os, const class restriction &c) {
os << "constraint " << c.name() << " for column " << c.column_name();
os << "constraint " << c.type_string() << " for column " << c.column_name();
return os;
}
std::string restriction::prefix() const {
std::string restriction::type_string() const {
if (utils::is_constraint_set(options_, utils::constraints::PrimaryKey)) {
return "PK_";
return "PrimaryKey";
}
if (utils::is_constraint_set(options_, utils::constraints::ForeignKey)) {
return "FK_";
return "ForeignKey";
}
if (utils::is_constraint_set(options_, utils::constraints::Unique)) {
return "UK_";
return "Unique";
}
return "";
return "Unknown";
}
// constraint_builder & constraint_builder::constraint(std::string name) {