code/prototype/vendor/bundle/ruby/2.3.0/gems/activerecord-5.0.7/lib/active_record/connection_adapters/postgresql/schema_statements.rb
# Maps logical Rails types to PostgreSQL-specific data types.
Maps logical Rails types to PostgreSQL-specific data types.
Maps logical Rails types to PostgreSQL - specific data types .
def type_to_sql(type, limit = nil, precision = nil, scale = nil, array = nil)
          sql = case type.to_s
          when 'binary'
            case limit
            when nil, 0..0x3fffffff; super(type)
            else raise(ActiveRecordError, "No binary type has byte size #{limit}.")
            end
          when 'text'
            case limit
            when nil, 0..0x3fffffff; super(type)
            else raise(ActiveRecordError, "The limit on text can be at most 1GB - 1byte.")
            end
          when 'integer'
            case limit
            when 1, 2; 'smallint'
            when nil, 3, 4; 'integer'
            when 5..8; 'bigint'
            else raise(ActiveRecordError, "No integer type has byte size #{limit}. Use a numeric with scale 0 instead.")
            end
          else
            super(type, limit, precision, scale)
          end
          sql << '[]' if array && type != :primary_key
          sql
        end
def type_to_sql ( type , limit = nil , precision = nil , scale = nil , array = nil ) sql = case type . to_s when 'binary' case limit when nil , 0 .. 0x3fffffff ; super ( type ) else raise ( ActiveRecordError , "No binary type has byte size #{limit}." ) end when 'text' case limit when nil , 0 .. 0x3fffffff ; super ( type ) else raise ( ActiveRecordError , "The limit on text can be at most 1GB - 1byte." ) end when 'integer' case limit when 1 , 2 ; 'smallint' when nil , 3 , 4 ; 'integer' when 5 .. 8 ; 'bigint' else raise ( ActiveRecordError , "No integer type has byte size #{limit}. Use a numeric with scale 0 instead." ) end else super ( type , limit , precision , scale ) end sql << '[]' if array && type != :primary_key sql end
Maps logical Rails types to PostgreSQL-specific data types.
Maps logical Rails types to PostgreSQL - specific data types .
# PostgreSQL doesn't support limits on binary (bytea) columns. # The hard limit is 1GB, because of a 32-bit size field, and TOAST. # PostgreSQL doesn't support limits on text columns. # The hard limit is 1GB, according to section 8.3 in the manual.
type
<not_specific>
limit
<not_specific>
precision
<not_specific>
scale
<not_specific>
array
<not_specific>