Flowdock
method

new_column_from_field

Importance_0
v5.2.3 - Show latest stable - 0 notes - Class: SchemaStatements
new_column_from_field(table_name, field) 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/connection_adapters/postgresql/schema_statements.rb, line 647
          def new_column_from_field(table_name, field)
            column_name, type, default, notnull, oid, fmod, collation, comment = field
            type_metadata = fetch_type_metadata(column_name, type, oid.to_i, fmod.to_i)
            default_value = extract_value_from_default(default)
            default_function = extract_default_function(default_value, default)

            PostgreSQLColumn.new(
              column_name,
              default_value,
              type_metadata,
              !notnull,
              table_name,
              default_function,
              collation,
              comment: comment.presence,
              max_identifier_length: max_identifier_length
            )
          end
Register or log in to add new notes.