-
Notifications
You must be signed in to change notification settings - Fork 314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
db:schema:load fails with error NoMethodError: undefined method 'to_sym' for {:type=>:string, :limit=>36}:Hash
#2340
Comments
NoMethodError: undefined method
to_sym' for {:type=>:string, :limit=>36}:Hash`NoMethodError: undefined method 'to_sym' for {:type=>:string, :limit=>36}:Hash
Hey i am facing this issue as well. is there a fix to this? Currently on:
|
@Physium For now, we solved it by applying monkey patches to our application. Added below patch and loaded this in config/initializers. See the attached screenshot. It worked for us. |
@roygopal thanks for sharing! Is there a reason why you patch here and not at this gem adapter level? |
No particular reason. Its just that in our app it was blocking other priority changes and due to time constraint we patched in our app. |
Apologies, what i meant was that i notice that the code is to override TableDefinitation class which seems like an ActiveRecord thing. Shouldn't the patch be targeting some class under the gem adapter layer? I dont know enough about this adapter and the underlyng of how it work hence would just like to understand how this patch works. |
Steps to reproduce
In schema.rb/oracle_schema.rb file the syntax that is generated for default id column is in hash notation.
It happens because of
id: { type: :string, limit: 191 }
syntax in oracle_schema.rb. When we change manually it toid: :string, limit: 36
then schema load passes.Generated migration (schema.rb/oracle_schema.rb)file has syntax as below
create_table "settings", primary_key: "name", id: { type: :string, limit: 191 }, force: :cascade do |t|
Expected behavior
db:schema:load should pass.
Actual behavior
On db:schema:load, it fails with error
NoMethodError: undefined method
to_sym' for {:type=>:string, :limit=>36}:Hash`System configuration
Rails version: 6.1
Oracle enhanced adapter version: 6.1.0
Ruby version: >=3.0
Oracle Database version: XE
The text was updated successfully, but these errors were encountered: