method
check_constraints_in_create
v6.1.3.1 -
Show latest stable
- Class:
ActiveRecord::SchemaDumper
check_constraints_in_create(table, stream)private
No documentation available.
# File activerecord/lib/active_record/schema_dumper.rb, line 222
def check_constraints_in_create(table, stream)
if (check_constraints = @connection.check_constraints(table)).any?
add_check_constraint_statements = check_constraints.map do |check_constraint|
parts = [
"t.check_constraint #{check_constraint.expression.inspect}"
]
if check_constraint.export_name_on_schema_dump?
parts << "name: #{check_constraint.name.inspect}"
end
" #{parts.join(', ')}"
end
stream.puts add_check_constraint_statements.sort.join("\n")
end
end