alphanodes / additionals

Redmine plugin for easy customization of settings, text and content display by using personal or role-based dashboards (drag&drop), providing wiki macros and act as library for other plugins.
https://www.redmine.org/plugins/additionals
GNU General Public License v2.0
131 stars 43 forks source link

Migrate error during installation #128

Open blackbart420 opened 2 years ago

blackbart420 commented 2 years ago

Hello, I get the following error when running the database migrate command on installation:

Column `project_id` on table `dashboards` does not match column `id` on `projects`, which has type `int(11)`. To resolve this issue, change the type of the `project_id` column on `dashboards` to be :integer. (For example `t.integer :project_id`).
Original message: Mysql2::Error: Can't create table `redmine_default`.`dashboards` (errno: 150 "Foreign key constraint is incorrectly formed")

I have the current redmine version: 4.2.3 and Ruby 2.7.0

Do you have a clue what's wrong?

Thanks

alexandermeindl commented 2 years ago

Which version of additionals do you use? And which database (version) you use?

additionals migration should create dashboards table with the column project_id as integer, see https://github.com/AlphaNodes/additionals/blob/main/db/migrate/003_create_dashboards.rb#L13

If this is not the case in your environment, maybe your database does not respect rails settings, which should be used from reference table. MySQL 8 works in our tests, see https://github.com/AlphaNodes/additionals/blob/main/.github/workflows/tests.yml#L41 Maybe an old mysql server version raises the problem. The problem cannot be fixed in your plugin.

More information to this topic can be found here: https://github.com/rails/rails/issues/30806

blackbart420 commented 2 years ago

Thank you for your answer. I tried to install the last version of Additionals (3.0.4). with redmine 4.2.3 ruby 2.7.0 rails 5.2.6 and mysql Ver 15.1 Distrib 10.3.32-MariaDB

So maybe the mariadb version is too old ?