Discourage (RuboCop?) defining constants in DB migrations

Problem

We have a mix of different migrations that sometimes define constants and sometimes do not. There isn't really much reason to be inconsistent. Several of us find that the version with constants is harder to grep for and harder to build automated static scanning tools for. There was a fairly wide agreement that we probably don't need to use the constants most of the time.

Bad:

TABLE_NAME = :new_table

create_table TABLE_NAME

Good:

create_table :new_table

Solution

Should we try to implement something with RuboCop to discourage adding constants? Are there edge cases we need to consider or just let people disable the rubocop rule as needed?

Edited by 🤖 GitLab Bot 🤖