Open reyeztom opened 8 years ago
Hey reyeztom, did you download the latest version? Version 2.1 of this plugin resolves that issue. We renamed the expenses table to contracts_expenses to avoid conflicts with other modules.
Thanks for your reply Wesley!
Yes I installed the latest version of the plugin. But as I can see the table first is installed as expenses and after that it is renamed to contracts_expenses. I already have a table expenses so that causes a problem.
And besides that it encounters an error on the url "/expenses" (rights maybe?)
2016-08-18 5:44 GMT+02:00 Wesley Jones notifications@github.com:
Hey reyeztom, did you download the latest version? Version 2.1 of this plugin resolves that issue. We renamed the expenses table to contracts_expenses to avoid conflicts with other modules.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/upgradeya/redmine-contracts-with-time-tracking-plugin/issues/43#issuecomment-240616419, or mute the thread https://github.com/notifications/unsubscribe-auth/AFr_AOb3uJBggEHmL_-PcSzYRN2tXaIRks5qg9UZgaJpZM4I6MoW .
Thanks reyeztom, I understand the issue now. I need to rethink how to address that for users that already have an existing expenses table.
How did you get to the url "/expenses"? Is that url used by the plugin that created the initial expenses table? I don't think the contracts module uses that url.
Thanks for your reply again!
Yes the url is from the existing expenss table and will be blocked in some kind of way by your plugin (...../projects/{projectnumber}/expenses)
2016-08-23 6:32 GMT+02:00 Wesley Jones notifications@github.com:
Thanks reyeztom, I understand the issue now. I need to rethink how to address that for users that already have an existing expenses table.
How did you get to the url "/expenses"? Is that url used by the plugin that created the initial expenses table? I don't think the contracts module uses that url.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/upgradeya/redmine-contracts-with-time-tracking-plugin/issues/43#issuecomment-241624229, or mute the thread https://github.com/notifications/unsubscribe-auth/AFr_AKcXruTLlNWhy_HIFPN3UCYuXQupks5qinfBgaJpZM4I6MoW .
Ok thanks. Do you mind posting the error here?
On Aug 23, 2016, at 3:22 AM, reyeztom notifications@github.com wrote:
Thanks for your reply again!
Yes the url is from the existing expenss table and will be blocked in some kind of way by your plugin (...../projects/{projectnumber}/expenses)
2016-08-23 6:32 GMT+02:00 Wesley Jones notifications@github.com:
Thanks reyeztom, I understand the issue now. I need to rethink how to address that for users that already have an existing expenses table.
How did you get to the url "/expenses"? Is that url used by the plugin that created the initial expenses table? I don't think the contracts module uses that url.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/upgradeya/redmine-contracts-with-time-tracking-plugin/issues/43#issuecomment-241624229, or mute the thread https://github.com/notifications/unsubscribe-auth/AFr_AKcXruTLlNWhy_HIFPN3UCYuXQupks5qinfBgaJpZM4I6MoW .
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.
Ok, I have updated the plugin so that it never creates an expenses table anymore. That should allow you to install the plugin with no errors.
As for the /expenses url conflict, I need a little more information. Can you copy/paste the routes related to expenses? It should be in the /config/routes.rb file in one of the CRM modules (probably redmine_contacts_invoices).
Ok I'll try to install this new version.
Hereby the routes:
resources :expenses do collection do get :bulk_edit, :context_menu post :bulk_edit, :bulk_update delete :bulk_destroy end end
resources :expense_imports, :only => [:new, :create]
resources :projects do resources :invoices, :only => [:index, :new, :create] resources :expenses, :only => [:index, :new, :create] resources :recurring_invoices, :only => [:index, :new, :create] end
Is this enough information for you?
Hi Wesley,
Unfortunately the new installation doesn't work out. After installing:
Can you help me how to solve this?
Cheers.
Hey, Make sure you have an expenses table. If it doesn't exist, check to see if it got renamed to contracts_expenses and rename it back to expenses.
Once you have confirmed you have an expenses table, uninstall the contracts plugin and make sure everything is back to normal. To uninstall run:
rake redmine:plugins:migrate NAME=contracts VERSION=0
Then let me know:
I have a problem installing the plugin. I'm already running the finance plugin of RedmineCRM which has a database table "expenses".
I now can see the "Contracts" tab, but when I click on "new contract" I'll see theinternal error message of Redmine.
rake redmine:plugins:migrate RAILS_ENV=production /var/lib/gems/1.9.1/gems/actionpack-4.2.4/lib/action_dispatch/http/mime_type.rb:163: warning: already initialized constant VCF Migrating clipboard_image_paste (Clipboard image paste)... Migrating contracts (Redmine Contracts With Time Tracking)... == 1 CreateContracts: migrating =============================================== -- create_table(:contracts) -> 0.0337s == 1 CreateContracts: migrated (0.0341s) ======================================
== 2 AddContractIdToTimeEntries: migrating ==================================== -- add_column(:time_entries, :contract_id, :integer) -> 0.5242s == 2 AddContractIdToTimeEntries: migrated (0.5244s) ===========================
== 3 AddPrecisionToHourlyRate: migrating ====================================== -- change_column(:contracts, :hourly_rate, :decimal, {:precision=>16, :scale=>2}) -> 0.0336s == 3 AddPrecisionToHourlyRate: migrated (0.0341s) =============================
== 4 CreateUserProjectRates: migrating ======================================== -- create_table(:user_project_rates) -> 0.0087s == 4 CreateUserProjectRates: migrated (0.0091s) ===============================
== 5 CreateUserContractRates: migrating ======================================= -- create_table(:user_contract_rates) -> 0.0104s == 5 CreateUserContractRates: migrated (0.0108s) ==============================
== 6 CreateExpenses: migrating ================================================ -- create_table(:expenses) rake aborted! StandardError: An error has occurred, all later migrations canceled:
Mysql2::Error: Table 'expenses' already exists: CREATE TABLE
expenses
(id
int(11) auto_increment PRIMARY KEY,name
varchar(255),expense_date
date,amount
float,contract_id
int(11),issue_id
int(11),description
varchar(255)) ENGINE=InnoDB/var/lib/gems/1.9.1/gems/activerecord-4.2.4/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:305:inquery' /var/lib/gems/1.9.1/gems/activerecord-4.2.4/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:305:in
block in execute' /var/lib/gems/1.9.1/gems/activerecord-4.2.4/lib/active_record/connection_adapters/abstract_adapter.rb:473:inblock in log' /var/lib/gems/1.9.1/gems/activesupport-4.2.4/lib/active_support/notifications/instrumenter.rb:20:in
instrument' /var/lib/gems/1.9.1/gems/activerecord-4.2.4/lib/active_record/connection_adapters/abstract_adapter.rb:467:inlog' /var/lib/gems/1.9.1/gems/activerecord-4.2.4/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:305:in
execute' /var/lib/gems/1.9.1/gems/activerecord-4.2.4/lib/active_record/connection_adapters/mysql2_adapter.rb:231:inexecute' /var/lib/gems/1.9.1/gems/activerecord-4.2.4/lib/active_record/connection_adapters/abstract/schema_statements.rb:208:in
create_table' /var/lib/gems/1.9.1/gems/activerecord-4.2.4/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:468:increate_table' /var/lib/gems/1.9.1/gems/activerecord-4.2.4/lib/active_record/migration.rb:662:in
block in method_missing' /var/lib/gems/1.9.1/gems/activerecord-4.2.4/lib/active_record/migration.rb:631:inblock in say_with_time' /var/lib/gems/1.9.1/gems/activerecord-4.2.4/lib/active_record/migration.rb:631:in
say_with_time' /var/lib/gems/1.9.1/gems/activerecord-4.2.4/lib/active_record/migration.rb:651:inmethod_missing' /opt/redmine-2.3/plugins/contracts/db/migrate/006_create_expenses.rb:3:in
change' /var/lib/gems/1.9.1/gems/activerecord-4.2.4/lib/active_record/migration.rb:605:inexec_migration' /var/lib/gems/1.9.1/gems/activerecord-4.2.4/lib/active_record/migration.rb:589:in
block (2 levels) in migrate' /var/lib/gems/1.9.1/gems/activerecord-4.2.4/lib/active_record/migration.rb:588:inblock in migrate' /var/lib/gems/1.9.1/gems/activerecord-4.2.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:292:in
with_connection' /var/lib/gems/1.9.1/gems/activerecord-4.2.4/lib/active_record/migration.rb:587:inmigrate' /var/lib/gems/1.9.1/gems/activerecord-4.2.4/lib/active_record/migration.rb:765:in
migrate' /var/lib/gems/1.9.1/gems/activerecord-4.2.4/lib/active_record/migration.rb:995:inblock in execute_migration_in_transaction' /var/lib/gems/1.9.1/gems/activerecord-4.2.4/lib/active_record/migration.rb:1043:in
ddl_transaction' /var/lib/gems/1.9.1/gems/activerecord-4.2.4/lib/active_record/migration.rb:994:inexecute_migration_in_transaction' /var/lib/gems/1.9.1/gems/activerecord-4.2.4/lib/active_record/migration.rb:956:in
block in migrate' /var/lib/gems/1.9.1/gems/activerecord-4.2.4/lib/active_record/migration.rb:952:ineach' /var/lib/gems/1.9.1/gems/activerecord-4.2.4/lib/active_record/migration.rb:952:in
migrate' /var/lib/gems/1.9.1/gems/activerecord-4.2.4/lib/active_record/migration.rb:820:inup' /var/lib/gems/1.9.1/gems/activerecord-4.2.4/lib/active_record/migration.rb:798:in
migrate' /opt/redmine-2.3/lib/redmine/plugin.rb:481:inmigrate_plugin' /opt/redmine-2.3/lib/redmine/plugin.rb:453:in
migrate' /opt/redmine-2.3/lib/redmine/plugin.rb:467:inblock in migrate' /opt/redmine-2.3/lib/redmine/plugin.rb:466:in
each' /opt/redmine-2.3/lib/redmine/plugin.rb:466:inmigrate' /opt/redmine-2.3/lib/tasks/redmine.rake:127:in
block (3 levels) in <top (required)>' Tasks: TOP => redmine:plugins:migrate (See full trace by running task with --trace)