dhanasingh / redmine_wktime

ERPmine is an open source free ERP for Service Industries. It runs within Redmine
https://erpmine.org/
Other
120 stars 79 forks source link

Error during migrate #271

Closed dr-consit closed 2 years ago

dr-consit commented 2 years ago

When trying to install I get the following error when trying to migrate the DB:

rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:

unknown attribute 'modules' for WkPermission.
/usr/share/rvm/gems/ruby-3.0.0/gems/activemodel-6.1.4.7/lib/active_model/attribute_assignment.rb:51:in `_assign_attribute'
/usr/share/rvm/gems/ruby-3.0.0/gems/activerecord-6.1.4.7/lib/active_record/attribute_assignment.rb:21:in `block in _assign_attributes'
/usr/share/rvm/gems/ruby-3.0.0/gems/activerecord-6.1.4.7/lib/active_record/attribute_assignment.rb:13:in `each'
/usr/share/rvm/gems/ruby-3.0.0/gems/activerecord-6.1.4.7/lib/active_record/attribute_assignment.rb:13:in `_assign_attributes'
/usr/share/rvm/gems/ruby-3.0.0/gems/activemodel-6.1.4.7/lib/active_model/attribute_assignment.rb:34:in `assign_attributes'
/usr/share/rvm/gems/ruby-3.0.0/gems/activerecord-6.1.4.7/lib/active_record/core.rb:510:in `initialize'
/usr/share/rvm/gems/ruby-3.0.0/gems/activerecord-6.1.4.7/lib/active_record/inheritance.rb:72:in `new'
/usr/share/rvm/gems/ruby-3.0.0/gems/activerecord-6.1.4.7/lib/active_record/inheritance.rb:72:in `new'
/usr/share/rvm/gems/ruby-3.0.0/gems/activerecord-6.1.4.7/lib/active_record/persistence.rb:37:in `create'
/usr/share/rvm/gems/ruby-3.0.0/gems/activerecord-6.1.4.7/lib/active_record/persistence.rb:35:in `block in create'
/usr/share/rvm/gems/ruby-3.0.0/gems/activerecord-6.1.4.7/lib/active_record/persistence.rb:35:in `collect'
/usr/share/rvm/gems/ruby-3.0.0/gems/activerecord-6.1.4.7/lib/active_record/persistence.rb:35:in `create'
/usr/share/redmine/plugins/redmine_wktime/db/migrate/20210129132620_create_wk_skill.rb:21:in `block (2 levels) in change'
/usr/share/rvm/gems/ruby-3.0.0/gems/activerecord-6.1.4.7/lib/active_record/migration.rb:752:in `up'
/usr/share/redmine/plugins/redmine_wktime/db/migrate/20210129132620_create_wk_skill.rb:17:in `block in change'
....

Relevant version information:

Environment:
  Redmine version                5.0.0.stable
  Ruby version                   3.0.0-p0 (2020-12-25) [x86_64-linux]
  Rails version                  6.1.4.7
  Environment                    production
  Database adapter               SQLServer
Arun-TAK commented 2 years ago

What version of ERPmine are you trying to install ?

dr-consit commented 2 years ago

Sorry, that is v4.6

Arun-TAK commented 2 years ago

Are you using sql server Database ? Can you try and run the db_migrate again and see ? It might work the second time.

dr-consit commented 2 years ago

Yes, I am using SQL server. And yes, rerunning the migrations worked.

I tried restoring a backup, to see if it was an intermittent problem, but it reappeared. Running the migrations a second time, worked again.

Thank you for your help.