dhanasingh / redmine_wktime

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

Mysql12:_:Error #125

Closed nachommm closed 7 years ago

nachommm commented 7 years ago

Redmine 3.4.2 ERPmine - Clone from the repository.

When I try to install the plugins I got this error:

ime RAILS_ENV=production (in /opt/redmine/redmine-3.4.2) Migrating redmine_wktime (ERPmine)... == 10 CreateWkInventory: migrating ============================================ -- create_table(:wk_product_categories) -> 0.0111s -- add_reference(:wk_product_categories, :parent, {:class=>"wk_product_categories", :index=>true}) -> 0.0157s -- create_table(:wk_mesure_units) -> 0.0050s -- create_table(:wk_brands) -> 0.0051s -- create_table(:wk_product_attributes) -> 0.0080s -- create_table(:wk_attribute_groups) -> 0.0060s -- create_table(:wk_products) -> 0.0145s -- create_table(:wk_product_models) -> 0.0105s -- create_table(:wk_brand_products) -> 0.0097s -- create_table(:wk_product_taxes) -> 0.0096s -- create_table(:wk_shipments) -> 0.0111s -- create_table(:wk_locations) -> 0.0114s -- create_table(:wk_product_items) -> 0.0125s -- create_table(:wk_inventory_items) -> 0.0234s -- add_reference(:wk_inventory_items, :parent, {:class=>"wk_inventory_items", :index=>true}) -> 0.0202s -- create_table(:wk_material_entries) -> 0.0138s -- add_index(:wk_material_entries, [:project_id], {:name=>:wk_material_entries_project_id}) -> 0.0063s -- add_index(:wk_material_entries, [:issue_id], {:name=>:wk_material_entries_issue_id}) -> 0.0054s -- add_reference(:wk_invoice_items, :product, {:class=>"wk_products", :index=>true}) rake aborted! StandardError: An error has occurred, all later migrations canceled:

Mysql2::Error: Table 'redmine.wk_invoice_items' doesn't exist: ALTER TABLE wk_invoice_items ADD product_id int(11) /opt/redmine/.rvm/gems/ruby-2.1.4/gems/mysql2-0.4.9/lib/mysql2/client.rb:120:in `_query'

There is no way to install the plugin and the only way to remove it is deleting all the tables manually from the DB.

Thanks in advance!

dhanasingh commented 7 years ago

It is running the version 10 of the migration script, which expects the table wk_invoice_items and it is not there.
are you installing the plugin for the first time, or you had a previous version and deleted the tables and trying the install the latest version ?

nachommm commented 7 years ago

Yes, I had a previous version and delete it manually because I got errors when I try to remove it.

dhanasingh commented 7 years ago

when uninstalling do not directly delete the tables, run the plugin migrate command with VERSION=0

rake redmine:plugins:migrate NAME=redmine_wktime VERSION=0 RAILS_ENV=production

this should drop the plugin tables.

Since you have deleted them manually, you may have to cleanup the schema_migrations table, check if you have entries for redline_wktime and remove them

1-redmine_wktime 2-redmine_wktime 3-redmine_wktime 4-redmine_wktime 5-redmine_wktime 6-redmine_wktime 7-redmine_wktime 8-redmine_wktime 9-redmine_wktime

After that you should be able to install the plugin

nachommm commented 7 years ago

Perfect! thanks a lot!

2017-10-25 11:03 GMT-03:00 Dhanasingh Krishnapandian < notifications@github.com>:

when uninstalling do not directly delete the tables, run the plugin migrate command with VERSION=0

rake redmine:plugins:migrate NAME=redmine_wktime VERSION=0 RAILS_ENV=production

this should drop the plugin tables.

Since you have deleted them manually, you may have to cleanup the schema_migrations table, check if you have entries for redline_wktime and remove them

1-redmine_wktime 2-redmine_wktime 3-redmine_wktime 4-redmine_wktime 5-redmine_wktime 6-redmine_wktime 7-redmine_wktime 8-redmine_wktime 9-redmine_wktime

After that you should be able to install the plugin

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/dhanasingh/redmine_wktime/issues/125#issuecomment-339340235, or mute the thread https://github.com/notifications/unsubscribe-auth/AGANxy3OFDfbCUAxEMJDWrEJt6p-cfZiks5svz-kgaJpZM4P_Y-8 .