Rails 3: migration error when using json as a column type in an ActiveRecord backed by Postgres
Change your migration like
class CreateThing < ActiveRecord::Migration
def change
create_table :things do |t|
t.integer :user_id
t.column :json_data, :json # Edited
t.timestamps
end
add_index :things, :user_id
end
end
And by default rake db
tasks will look into schema.rb( which wont be the case for postgres) so in application.rb change it to
config.active_record.schema_format = :sql