Skip to content

Add spec for schema.rb

blackst0ne requested to merge blackst0ne/gitlab-ce:spec_for_schema into master

What does this MR do?

It adds a new spec to check:

  1. If db/schema.rb defined version equals the latest migration file's timestamp both from db/migration and db/post_migrate directories.
  2. If db/schema.rb defined version equals the latest migration's timestamp stored in the database's schema_migrations table.

Are there points in the code the reviewer needs to double check?

I did not use

require Rails.root.join('db', 'schema')

to prevent extra database initializing in the spec.

Why was this MR needed?

It's needed to prevent schema.rb version mismatching.

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

Closes #21978 (closed)

Merge request reports