Skip to content

Can't create a table with default bigint primary key. #2382

@jva

Description

@jva

Steps to reproduce

I can't get the standalone tests running on ARM64. But here is the code that reproduces it in my schema.rb:

create_table "account_users", id: { limit: 19, precision: 19 }, force: :cascade do |t|
t.integer "account_id", limit: 19, precision: 19, null: false
...

Expected behavior

rails db:test:prepare command should execute and create table with large number primary key

Actual behavior

╰─± rails db:test:prepare --trace
** Invoke db:test:prepare (first_time)
** Invoke db:load_config (first_time)
** Invoke environment (first_time)
** Execute environment
DEBUG: database.yml using Oracle database
** Execute db:load_config
** Execute db:test:prepare
** Invoke db:test:load (first_time)
** Invoke db:test:purge (first_time)
** Invoke db:load_config
** Invoke db:check_protected_environments (first_time)
** Invoke db:load_config
** Execute db:check_protected_environments
** Execute db:test:purge
** Execute db:test:load
** Invoke db:test:load_schema (first_time)
** Invoke db:test:purge
** Execute db:test:load_schema
rails aborted!
NoMethodError: undefined method `to_sym' for {:limit=>19, :precision=>19}:Hash
Did you mean?  to_s
               to_set
/Users/jva/.rvm/gems/jruby-9.3.13.0@rails61/gems/activerecord-6.1.7.7/lib/active_record/connection_adapters/abstract/schema_definitions.rb:407:in `column'
/Users/jva/.rvm/gems/jruby-9.3.13.0@rails61/gems/activerecord-6.1.7.7/lib/active_record/connection_adapters/abstract/schema_definitions.rb:242:in `primary_key'
/Users/jva/.rvm/gems/jruby-9.3.13.0@rails61/gems/activerecord-oracle_enhanced-adapter-6.1.6/lib/active_record/connection_adapters/oracle_enhanced/schema_definitions.rb:9:in `primary_key'
/Users/jva/.rvm/gems/jruby-9.3.13.0@rails61/gems/activerecord-oracle_enhanced-adapter-6.1.6/lib/active_record/connection_adapters/oracle_enhanced/schema_statements.rb:214:in `create_table'

System configuration

Rails version: gem 'rails', '6.1.7.7'

Oracle enhanced adapter version: activerecord-oracle_enhanced-adapter (6.1.6)

Ruby version: jruby 9.3.13.0 (2.6.8) 2023-11-02 09b6f2263a OpenJDK 64-Bit Server VM 11.0.19+7 on 11.0.19+7 [arm64-darwin]

Oracle Database version: Oracle Database 21c Express Edition Release 21.0.0.0.0 - Production

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions