Skip to content
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

Migrate error during installation #128

Open
blackbart420 opened this issue Feb 14, 2022 · 2 comments
Open

Migrate error during installation #128

blackbart420 opened this issue Feb 14, 2022 · 2 comments

Comments

@blackbart420
Copy link

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
Copy link
Collaborator

alexandermeindl commented Feb 14, 2022

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: rails/rails#30806

@blackbart420
Copy link
Author

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 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants