fixed restriction and constraint class to use size_t
This commit is contained in:
@@ -33,7 +33,7 @@ query_add_foreign_key_constraint_intermediate query_add_key_constraint_intermedi
|
||||
|
||||
executable_query query_alter_table_intermediate::add_constraint(const object::restriction &rest) {
|
||||
context_->parts.push_back(std::make_unique<internal::query_add_constraint_part_by_constraint>(
|
||||
table_constraint{rest.column_name(), rest.owner()->name(), rest.attribute().attributes().options(), rest.ref_table_name(), rest.ref_column_name()}
|
||||
table_constraint{rest.column_name(), rest.owner()->name(), rest.options(), rest.ref_table_name(), rest.ref_column_name()}
|
||||
));
|
||||
|
||||
return {context_};
|
||||
@@ -47,7 +47,7 @@ query_add_key_constraint_intermediate query_alter_table_intermediate::add_constr
|
||||
|
||||
executable_query query_alter_table_intermediate::drop_constraint(const object::restriction &rest) {
|
||||
context_->parts.push_back(std::make_unique<internal::query_drop_key_constraint_part_by_constraint>(
|
||||
table_constraint{rest.column_name(), rest.owner()->name(), rest.attribute().attributes().options(), rest.ref_table_name(), rest.ref_column_name()})
|
||||
table_constraint{rest.column_name(), rest.owner()->name(), rest.options(), rest.ref_table_name(), rest.ref_column_name()})
|
||||
);
|
||||
return {context_};
|
||||
}
|
||||
|
||||
@@ -46,11 +46,11 @@ executable_query query_create_table_columns_intermediate::constraints(const std:
|
||||
std::list<table_constraint> constraints;
|
||||
for (const auto& restr : restrictions) {
|
||||
if (restr.is_primary_key_constraint()) {
|
||||
constraints.emplace_back(restr.column_name(), restr.owner()->name(), restr.attribute().attributes().options());
|
||||
constraints.emplace_back(restr.column_name(), restr.owner()->name(), restr.options());
|
||||
} else if (restr.is_foreign_key_constraint()) {
|
||||
constraints.emplace_back(restr.column_name(), restr.owner()->name(), restr.attribute().attributes().options(), restr.ref_table_name(), restr.ref_column_name());
|
||||
constraints.emplace_back(restr.column_name(), restr.owner()->name(), restr.options(), restr.ref_table_name(), restr.ref_column_name());
|
||||
} else if (restr.is_unique_constraint()) {
|
||||
constraints.emplace_back(restr.column_name(), restr.owner()->name(), restr.attribute().attributes().options());
|
||||
constraints.emplace_back(restr.column_name(), restr.owner()->name(), restr.options());
|
||||
}
|
||||
}
|
||||
context_->parts.push_back(std::make_unique<internal::query_create_table_constraints_part>(constraints));
|
||||
|
||||
Reference in New Issue
Block a user