Skip to content

Use db:schema instead of db:structure rake task

Igor Drozdov requested to merge id-change-db-rake-task into master

What does this MR do and why?

The db:structure rake task is deprecated in favor of db:schema and is going to be removed in Rails 7. Currently, Rails 7 CI fails with this error: https://gitlab.com/gitlab-org/gitlab/-/jobs/3852499876#L103

Don't know how to build task 'db:structure:load:ci' (See the list of available tasks with `rake --tasks`)
Did you mean?  db:schema:load:ci

Since config.active_record.schema_format is specified to :sql, db:schema should behave just like db:structure. With this change, the job is successfully executed for the current version of Rails:

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Igor Drozdov

Merge request reports