Skip to content

Postgres Array of Integers changes to simply Integer in production #10493

Closed
@lmcardle

Description

@lmcardle

Previously I was running this app in Rails --pre and all worked well. However, I recently switched to RC1 and that's when I started getting this issue.

In development, using Postgres as the database, I am creating a column that will store an array of integers. If I look at the schema.rb file, everything looks right and actually runs correctly in the console. Below is my schema.rb file for that table.

create_table "cards", force: true do |t|
t.string "miscellaneous", default: [], array: true
t.integer "ministries", default: [], array: true
end

When I deploy to production, all arrays that are of "string" type still work as expected. However, the "integer" type arrays are being changed from type array to simply type integer. See below for the schema.rb file:

create_table "cards", force: true do |t|
t.string "miscellaneous", default: "{}"
t.integer "ministries", default: 0
end

Any idea what might have caused this? As I said, it was working in production fine with the pre version of Rails 4. This just started when I upgraded to RC1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions