removed attribute_generator and constraints_generator
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user