gtt-project / redmine_custom_fields_groups

Redmine plugin for grouping custom fields.
GNU General Public License v3.0
12 stars 4 forks source link

Deploying on Redmine 5.x did not work. May be a DB issue #19

Closed whotopia closed 2 years ago

whotopia commented 2 years ago

Upon trying to deploy this addon I get:


== 20211011081244 CreateCustomFieldsGroupFields: migrating ====================
-- create_table(:custom_fields_group_fields, {:id=>false})
rake aborted!
StandardError: An error has occurred, all later migrations canceled:

Column `custom_fields_group_id` on table `custom_fields_group_fields` does not match column `id` on `custom_fields_groups`, which has type `bigint(20)`. To resolve this issue, change the type of the `custom_fields_group_id` column on `custom_fields_group_fields` to be :bigint. (For example `t.bigint :custom_fields_group_id`).
Original message: Mysql2::Error: Can't create table `db_redmine`.`custom_fields_group_fields` (errno: 150 "Foreign key constraint is incorrectly formed")
/home/finddx-rm/redmine-5.0.2/plugins/redmine_custom_fields_groups/db/migrate/20211011081244_create_custom_fields_group_fields.rb:3:in `change'
/home/finddx-rm/redmine-5.0.2/lib/redmine/plugin.rb:468:in `up'
/home/finddx-rm/redmine-5.0.2/lib/redmine/plugin.rb:500:in `migrate_plugin'
/home/finddx-rm/redmine-5.0.2/lib/redmine/plugin.rb:441:in `migrate'
/home/finddx-rm/redmine-5.0.2/lib/redmine/plugin.rb:455:in `block in migrate'
/home/finddx-rm/redmine-5.0.2/lib/redmine/plugin.rb:454:in `each'
/home/finddx-rm/redmine-5.0.2/lib/redmine/plugin.rb:454:in `migrate'
/home/finddx-rm/redmine-5.0.2/lib/tasks/redmine.rake:151:in `block (3 levels) in <top (required)>'
/home/finddx-rm/.rbenv/versions/2.7.2/bin/bundle:23:in `load'
/home/finddx-rm/.rbenv/versions/2.7.2/bin/bundle:23:in `<main>'

Caused by:
ActiveRecord::MismatchedForeignKey: Column `custom_fields_group_id` on table `custom_fields_group_fields` does not match column `id` on `custom_fields_groups`, which has type `bigint(20)`. To resolve this issue, change the type of the `custom_fields_group_id` column on `custom_fields_group_fields` to be :bigint. (For example `t.bigint :custom_fields_group_id`).
Original message: Mysql2::Error: Can't create table `db_redmine`.`custom_fields_group_fields` (errno: 150 "Foreign key constraint is incorrectly formed")
/home/finddx-rm/redmine-5.0.2/plugins/redmine_custom_fields_groups/db/migrate/20211011081244_create_custom_fields_group_fields.rb:3:in `change'
/home/finddx-rm/redmine-5.0.2/lib/redmine/plugin.rb:468:in `up'
/home/finddx-rm/redmine-5.0.2/lib/redmine/plugin.rb:500:in `migrate_plugin'
/home/finddx-rm/redmine-5.0.2/lib/redmine/plugin.rb:441:in `migrate'
/home/finddx-rm/redmine-5.0.2/lib/redmine/plugin.rb:455:in `block in migrate'
/home/finddx-rm/redmine-5.0.2/lib/redmine/plugin.rb:454:in `each'
/home/finddx-rm/redmine-5.0.2/lib/redmine/plugin.rb:454:in `migrate'
/home/finddx-rm/redmine-5.0.2/lib/tasks/redmine.rake:151:in `block (3 levels) in <top (required)>'
/home/finddx-rm/.rbenv/versions/2.7.2/bin/bundle:23:in `load'
/home/finddx-rm/.rbenv/versions/2.7.2/bin/bundle:23:in `<main>'
sanak commented 2 years ago

@whotopia Thanks for reporting this issue! I will try to check the cause and fix this issue, so please wait for a while.

sanak commented 2 years ago

@whotopia I fixed this issue on PR #20 and merged it, so please check the latest main branch. 🙇