fixed schema creation
This commit is contained in:
@@ -52,6 +52,10 @@ attribute* basic_object_info::primary_key_attribute() const {
|
||||
return object_->primary_key_attribute();
|
||||
}
|
||||
|
||||
void basic_object_info::update_name(const std::string& name) {
|
||||
object_->update_name(name);
|
||||
}
|
||||
|
||||
basic_object_info::endpoint_iterator basic_object_info::register_relation_endpoint(const std::type_index &type, const std::shared_ptr<relation_endpoint> &endpoint) {
|
||||
return relation_endpoints_.insert(std::make_pair(type, endpoint)).first;
|
||||
}
|
||||
|
||||
@@ -43,6 +43,13 @@ const std::string& object::alias() const {
|
||||
|
||||
void object::update_name(const std::string& name) {
|
||||
name_ = name;
|
||||
for (auto& con : constraints_) {
|
||||
if (con.is_primary_key_constraint()) {
|
||||
con.name_ += name;
|
||||
} else if (con.is_foreign_key_constraint()) {
|
||||
con.name_ = "FK_" + name + "_" + con.column_name();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool object::has_attributes() const {
|
||||
|
||||
@@ -45,9 +45,7 @@ const basic_object_info &repository_node::info() const {
|
||||
|
||||
void repository_node::update_name(const std::string& name) {
|
||||
name_ = name;
|
||||
// if (info_->reference_column()) {
|
||||
// info_->reference_column()->table_name(name);
|
||||
// }
|
||||
info_->update_name(name);
|
||||
}
|
||||
|
||||
const repository& repository_node::schema() const {
|
||||
|
||||
Reference in New Issue
Block a user