Fix Rails/SquishedSQLHeredocs cop (#24694)

This commit is contained in:
Matt Jankowski
2023-04-30 00:43:50 -04:00
committed by GitHub
parent 8dcfb6e0ea
commit 60ac9e8634
6 changed files with 7 additions and 16 deletions

View File

@@ -4,7 +4,7 @@ class StatusIdsToTimestampIds < ActiveRecord::Migration[5.1]
Mastodon::Snowflake.define_timestamp_id
# Set up the statuses.id column to use our timestamp-based IDs.
ActiveRecord::Base.connection.execute(<<~SQL)
ActiveRecord::Base.connection.execute(<<~SQL.squish)
ALTER TABLE statuses
ALTER COLUMN id
SET DEFAULT timestamp_id('statuses')
@@ -21,7 +21,7 @@ class StatusIdsToTimestampIds < ActiveRecord::Migration[5.1]
# We lock the table during this so that the ID won't get clobbered,
# but ID is indexed, so this should be a fast operation.
ActiveRecord::Base.connection.execute(<<~SQL)
ActiveRecord::Base.connection.execute(<<~SQL.squish)
LOCK statuses;
SELECT setval('statuses_id_seq', (SELECT MAX(id) FROM statuses));
ALTER TABLE statuses