Follow-up from "Project Import: Fail gracefully & record failures"

The following discussion from !20727 (merged) should be addressed:

  • !20727 (comment 251049424)

Create a Rubocop cop to check table columns order, as per the guideline in https://docs.gitlab.com/ee/development/ordering_table_columns.html

Details:

For migration script which create new database table, we can create a Rubocop rule, calculate each column's type size based on https://docs.gitlab.com/ee/development/ordering_table_columns.html#type-sizes, and then check the columns follow the rule:

For GitLab we require that columns of new tables are ordered based to use the least amount of space. An easy way of doing this is to order them based on the type size in descending order with variable sizes (text, varchar, arrays, json, jsonb, and so on) at the end

Edited Jul 07, 2025 by 🤖 GitLab Bot 🤖
Assignee Loading
Time tracking Loading