it'registers an offense when adding a column to a wide table'do
offense='`projects` is a wide table with several columns, addig more should be avoided unless absolutely necessary. Consider storing the column in a different table or creating a new one.'
offense='`projects` is a wide table with several columns, [...]'
expect_offense(<<~RUBY)
def up
...
...
@@ -37,7 +35,7 @@ RSpec.describe RuboCop::Cop::Migration::AddColumnsToWideTables do
end
it'registers an offense when adding a column with default to a wide table'do
offense='`users` is a wide table with several columns, addig more should be avoided unless absolutely necessary. Consider storing the column in a different table or creating a new one.'
offense='`users` is a wide table with several columns, [...]'
expect_offense(<<~RUBY)
def up
...
...
@@ -48,7 +46,7 @@ RSpec.describe RuboCop::Cop::Migration::AddColumnsToWideTables do
end
it'registers an offense when adding a reference'do
offense='`ci_builds` is a wide table with several columns, addig more should be avoided unless absolutely necessary. Consider storing the column in a different table or creating a new one.'
offense='`ci_builds` is a wide table with several columns, [...]'
expect_offense(<<~RUBY)
def up
...
...
@@ -59,7 +57,7 @@ RSpec.describe RuboCop::Cop::Migration::AddColumnsToWideTables do
end
it'registers an offense when adding timestamps'do
offense='`projects` is a wide table with several columns, addig more should be avoided unless absolutely necessary. Consider storing the column in a different table or creating a new one.'
offense='`projects` is a wide table with several columns, [...]'
let(:offense){'`add_reference` requires downtime for existing tables, use `add_concurrent_foreign_key` instead. When used for new tables, `index: true` or `index: { options... } is required.`'}
let(:offense){'`add_reference` requires downtime for existing tables, use `add_concurrent_foreign_key`[...]'}
context'when the table existed before'do
it'registers an offense when using add_reference'do