-
Notifications
You must be signed in to change notification settings - Fork 22
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
Problem with Expenses table I guess #43
Comments
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. And besides that it encounters an error on the url "/expenses" (rights 2016-08-18 5:44 GMT+02:00 Wesley Jones [email protected]:
|
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 2016-08-23 6:32 GMT+02:00 Wesley Jones [email protected]:
|
Ok thanks. Do you mind posting the error here?
|
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 resources :expense_imports, :only => [:new, :create] resources :projects do 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, Once you have confirmed you have an expenses table, uninstall the contracts plugin and make sure everything is back to normal. To uninstall run:
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:in
block 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:in
log' /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:in
execute' /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:in
create_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:in
block 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:in
method_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:in
exec_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:in
block 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:in
migrate' /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:in
block 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:in
execute_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:in
each' /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:in
up' /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:in
migrate_plugin' /opt/redmine-2.3/lib/redmine/plugin.rb:453:in
migrate'/opt/redmine-2.3/lib/redmine/plugin.rb:467:in
block in migrate' /opt/redmine-2.3/lib/redmine/plugin.rb:466:in
each'/opt/redmine-2.3/lib/redmine/plugin.rb:466:in
migrate' /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)
The text was updated successfully, but these errors were encountered: