preparations for object class changes
This commit is contained in:
parent
108eca4e53
commit
d4a8801cd2
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
#include "matador/utils/constraints.hpp"
|
||||
|
||||
#include <memory>
|
||||
#include <ostream>
|
||||
#include <string>
|
||||
#include <variant>
|
||||
|
|
@ -57,6 +58,7 @@ public:
|
|||
private:
|
||||
std::string constraint_name;
|
||||
utils::constraints options_{utils::constraints::None};
|
||||
std::shared_ptr<object> reference_;
|
||||
std::string column_name;
|
||||
std::string ref_table_name;
|
||||
std::string ref_column_name;
|
||||
|
|
|
|||
|
|
@ -26,9 +26,13 @@ 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 result = repo_.basic_info(ti);
|
||||
if (!result) {
|
||||
repo_.provide_object_in_advance(ti, std::make_shared<object>(""));
|
||||
repo_.has_object_for_type(ti);
|
||||
repo_.object_for_type(ti);
|
||||
repo_.remove_object_for_type(ti);
|
||||
return;
|
||||
}
|
||||
const auto *pk_attribute = result.value().get().primary_key_attribute();
|
||||
const auto *pk_attribute = result->get().primary_key_attribute();
|
||||
class constraint 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_)) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue