Flowdock
method

check_constraints_in_create

Importance_0
v6.1.3.1 - Show latest stable - 0 notes - Class: ActiveRecord::SchemaDumper
check_constraints_in_create(table, stream) private

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# 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
Register or log in to add new notes.