method
check_constraints_in_create
rails latest stable - Class:
ActiveRecord::SchemaDumper
check_constraints_in_create(table, stream)private
No documentation available.
# File activerecord/lib/active_record/schema_dumper.rb, line 263
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 << "validate: #{check_constraint.validate?.inspect}" unless check_constraint.validate?
" #{parts.join(', ')}"
end
stream.puts add_check_constraint_statements.sort.join("\n")
end
end