I have a table which was originally defined with a default value for one column. I need to change or remove the default.
- RubyOnRails.org seems (by its silence) to say this change is not wrapped for portability by
ActiveRecord::Migration
. - W3schools seems to say the SQL needed is not portable between MySQL and SQLite (my two DBs).
If I misread either of those, then straightening me out would be sufficient. Otherwise:
- From within an
ActiveRecord::Migration#up
routine, how can I write anexecute
call that's sensitive to the underlying DB? Can I, for instance, see the active values fromconfig/database.yml
?
Current table defn (from db/schema.rb
) is:
create_table "apis", force: true do |t|
t.string "provider"
t.string "endpoint"
t.string "name"
t.integer "owner_id"
t.string "status"
t.datetime "created_at"
t.datetime "updated_at"
t.string "apiary_dev_domain"
t.string "resource_root", default: "/v1", null: false
t.text "description"
end