In Rails 7, the schema.db does not explicitly mention the type of the primary key so when importing a table like this ;-
ctiveRecord::Schema[7.0].define(version: 2023_08_06_064351) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
create_table "accounts", force: :cascade do |t|
t.string "name"
t.string "number"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
it infers the PK to be id
but with a type varchar
, when in fact it’s a bigint.