title: MySQL double to PostgreSQL double precision works, but default column value does not exist in schema.rb dump
body: <p>I converted a MySQL database to PostgreSQL in a Rails app, and the MySQL <code>double</code> column was converted to a <code>double precision</code> column in PostgreSQL.</p>
  
  <p>The problem is that even if the PostgreSQL structure has this column with a default value of "0::double precision", <code>rake db:schema:dump</code> does not add this default value.</p>
  
  <p>Therefore, when a model instance is created, the default value is not auto-assigned, and instead its value is <code>nil</code>.</p>
  
  <p>Now, I'm on Rails 4.1.6, and this happens because the column type is not listed <a href="https://github.com/rails/rails/blob/4-1-stable/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb#L82-L142" rel="nofollow">here</a> (AFAIK).  What is strange (to me) is why this hasn't been added yet. </p>
  
  <p>What could be the recommended approach here?  Change the column type in PostgreSQL?</p>
  
  <p>A <code>\d payments</code> from inside <code>psql</code> says:</p>
  
  <pre><code>                                       Table "public.payments"
       Column     |            Type             |                       Modifiers                       
  ----------------+-----------------------------+-------------------------------------------------------
   id             | integer                     | not null default nextval('payments_id_seq'::regclass)
   credit_card_id | integer                     | not null default 0
   order_id       | integer                     | not null default 0
   amount         | double precision            | not null default 0::double precision
   created_at     | timestamp without time zone | not null
   updated_at     | timestamp without time zone | not null
   authorization  | character varying(510)      | default NULL::character varying
  Indexes:
      "payments_pkey" PRIMARY KEY, btree (id)
      "credit_card_id" btree (credit_card_id)
      "purchase_order_id_1" btree (order_id)
  </code></pre>
  
  <p>and the corresponding section of <code>schema.rb</code> says:</p>
  
  <pre><code>create_table "payments", force: true do |t|
    t.integer  "credit_card_id",             default: 0, null: false
    t.integer  "order_id",                   default: 0, null: false
    t.float    "amount",                                 null: false
    t.datetime "created_at",                             null: false
    t.datetime "updated_at",                             null: false
    t.string   "authorization",  limit: 510
  end
  </code></pre>