0
0
Fork 0

Enable Rubocop Style/FrozenStringLiteralComment (#23793)

This commit is contained in:
Nick Schonning 2023-07-12 03:47:08 -04:00 committed by GitHub
parent 9e8bc56d5a
commit 1d557305d2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
394 changed files with 784 additions and 399 deletions

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class CreateAccounts < ActiveRecord::Migration[4.2]
def change
create_table :accounts do |t|

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class CreateStatuses < ActiveRecord::Migration[4.2]
def change
create_table :statuses do |t|

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class CreateUsers < ActiveRecord::Migration[4.2]
def change
create_table :users do |t|

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class CreateFollows < ActiveRecord::Migration[4.2]
def change
create_table :follows do |t|

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class CreateStreamEntries < ActiveRecord::Migration[4.2]
def change
create_table :stream_entries do |t|

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class AddProfileFieldsToAccounts < ActiveRecord::Migration[4.2]
def change
add_column :accounts, :note, :text, null: false, default: ''

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class AddMetadataToStatuses < ActiveRecord::Migration[4.2]
def change
add_column :statuses, :in_reply_to_id, :integer, null: true

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class MakeUrisNullableInStatuses < ActiveRecord::Migration[4.2]
def change
change_column :statuses, :uri, :string, null: true, default: nil

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class AddURLToStatuses < ActiveRecord::Migration[4.2]
def change
add_column :statuses, :url, :string, null: true, default: nil

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class AddURLToAccounts < ActiveRecord::Migration[4.2]
def change
add_column :accounts, :url, :string, null: true, default: nil

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class CreateFavourites < ActiveRecord::Migration[4.2]
def change
create_table :favourites do |t|

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class CreateMentions < ActiveRecord::Migration[4.2]
def change
create_table :mentions do |t|

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class AddAttachmentAvatarToAccounts < ActiveRecord::Migration[4.2]
def self.up
change_table :accounts do |t|

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class AddDeviseToUsers < ActiveRecord::Migration[4.2]
def self.up
change_table(:users) do |t|

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class CreateDoorkeeperTables < ActiveRecord::Migration[4.2]
def change
create_table :oauth_applications do |t|

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class AddAttachmentHeaderToAccounts < ActiveRecord::Migration[4.2]
def self.up
change_table :accounts do |t|

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class AddOwnerToApplication < ActiveRecord::Migration[4.2]
def change
add_column :oauth_applications, :owner_id, :integer, null: true

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class AddMissingIndices < ActiveRecord::Migration[4.2]
def change
add_index :users, :account_id

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class AddAvatarRemoteURLToAccounts < ActiveRecord::Migration[4.2]
def change
add_column :accounts, :avatar_remote_url, :string, null: true, default: nil

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class AddAdminToUsers < ActiveRecord::Migration[4.2]
def change
add_column :users, :admin, :boolean, default: false

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class AddSuperappToOauthApplications < ActiveRecord::Migration[5.0]
def change
add_column :oauth_applications, :superapp, :boolean, default: false, null: false

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class CreateMediaAttachments < ActiveRecord::Migration[5.0]
def change
create_table :media_attachments do |t|

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class AddSubscriptionExpiresAtToAccounts < ActiveRecord::Migration[5.0]
def change
add_column :accounts, :subscription_expires_at, :datetime, null: true, default: nil

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class RemoveVerifyTokenFromAccounts < ActiveRecord::Migration[5.0]
def change
remove_column :accounts, :verify_token, :string, null: false, default: ''

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class RemoveOwnerFromApplication < ActiveRecord::Migration[5.0]
def change
remove_index :oauth_applications, [:owner_id, :owner_type]

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class AddConfirmableToUsers < ActiveRecord::Migration[5.0]
def change
add_column :users, :confirmation_token, :string

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class CreateBlocks < ActiveRecord::Migration[5.0]
def change
create_table :blocks do |t|

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
MIGRATION_BASE_CLASS = if ActiveRecord::VERSION::MAJOR >= 5
ActiveRecord::Migration[5.0]
else

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class CreateDomainBlocks < ActiveRecord::Migration[5.0]
def change
create_table :domain_blocks do |t|

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class AddSilencedToAccounts < ActiveRecord::Migration[5.0]
def change
add_column :accounts, :silenced, :boolean, null: false, default: false

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class CreateTags < ActiveRecord::Migration[5.0]
def change
create_table :tags do |t|

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class CreateStatusesTagsJoinTable < ActiveRecord::Migration[5.0]
def change
create_join_table :statuses, :tags do |t|

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class AddLocaleToUsers < ActiveRecord::Migration[5.0]
def change
add_column :users, :locale, :string

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class CreateNotifications < ActiveRecord::Migration[5.0]
def change
create_table :notifications do |t|

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class RemoveUnneededIndexes < ActiveRecord::Migration[5.0]
def change
remove_index :notifications, name: 'index_notifications_on_account_id'

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class AddSensitiveToStatuses < ActiveRecord::Migration[5.0]
def change
add_column :statuses, :sensitive, :boolean, default: false

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class CreateSubscriptions < ActiveRecord::Migration[5.0]
def change
create_table :subscriptions do |t|

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class AddLastSuccessfulDeliveryAtToSubscriptions < ActiveRecord::Migration[5.0]
def change
add_column :subscriptions, :last_successful_delivery_at, :datetime, null: true, default: nil

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class AddVisibilityToStatuses < ActiveRecord::Migration[5.0]
def change
add_column :statuses, :visibility, :integer, null: false, default: 0

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class AddInReplyToAccountIdToStatuses < ActiveRecord::Migration[5.0]
def up
add_column :statuses, :in_reply_to_account_id, :integer, null: true, default: nil

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class AddFromAccountIdToNotifications < ActiveRecord::Migration[5.0]
def up
add_column :notifications, :from_account_id, :integer

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class AddSuspendedToAccounts < ActiveRecord::Migration[5.0]
def change
add_column :accounts, :suspended, :boolean, null: false, default: false

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class AddHiddenToStreamEntries < ActiveRecord::Migration[5.0]
def change
add_column :stream_entries, :hidden, :boolean, null: false, default: false

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class AddLockedToAccounts < ActiveRecord::Migration[5.0]
def change
add_column :accounts, :locked, :boolean, null: false, default: false

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class CreateFollowRequests < ActiveRecord::Migration[5.0]
def change
create_table :follow_requests do |t|

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class AddShortcodeToMediaAttachments < ActiveRecord::Migration[5.0]
def up
add_column :media_attachments, :shortcode, :string, null: true, default: nil

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class CreateWebSettings < ActiveRecord::Migration[5.0]
def change
create_table :web_settings do |t|

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class MigrateSettings < ActiveRecord::Migration[4.2]
def up
remove_index :settings, [:target_type, :target_id, :var]

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class AddApplicationToStatuses < ActiveRecord::Migration[5.0]
def change
add_column :statuses, :application_id, :int

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class AddWebsiteToOauthApplication < ActiveRecord::Migration[5.0]
def change
add_column :oauth_applications, :website, :string

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class CreatePreviewCards < ActiveRecord::Migration[5.0]
def change
create_table :preview_cards do |t|

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class AddSeverityToDomainBlocks < ActiveRecord::Migration[5.0]
def change
add_column :domain_blocks, :severity, :integer, default: 0

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class AddRejectMediaToDomainBlocks < ActiveRecord::Migration[5.0]
def change
add_column :domain_blocks, :reject_media, :boolean

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class AddSpoilerTextToStatuses < ActiveRecord::Migration[5.0]
def change
add_column :statuses, :spoiler_text, :text, default: '', null: false

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class AddDeviseTwoFactorToUsers < ActiveRecord::Migration[5.0]
def change
add_column :users, :encrypted_otp_secret, :string

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class RemoveDevices < ActiveRecord::Migration[5.0]
def change
drop_table :devices if table_exists?(:devices)

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class AddReplyToStatuses < ActiveRecord::Migration[5.0]
def up
add_column :statuses, :reply, :boolean, nil: false, default: false

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class CreateReports < ActiveRecord::Migration[5.0]
def change
create_table :reports do |t|

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class AddReblogOfIdForeignKeyToStatuses < ActiveRecord::Migration[5.0]
def change
add_foreign_key :statuses, :statuses, column: :reblog_of_id, on_delete: :cascade

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class CreateMutes < ActiveRecord::Migration[5.0]
def change
create_table :mutes do |t|

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class AddLastEmailedAtToUsers < ActiveRecord::Migration[5.0]
def change
add_column :users, :last_emailed_at, :datetime, null: true, default: nil

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class AddTypeToMediaAttachments < ActiveRecord::Migration[5.0]
def up
add_column :media_attachments, :type, :integer, default: 0, null: false

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class AddSearchIndexToAccounts < ActiveRecord::Migration[5.0]
def up
execute 'CREATE INDEX search_index ON accounts USING gin((setweight(to_tsvector(\'simple\', accounts.display_name), \'A\') || setweight(to_tsvector(\'simple\', accounts.username), \'B\') || setweight(to_tsvector(\'simple\', coalesce(accounts.domain, \'\')), \'C\')));'

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class AddHeaderRemoteURLToAccounts < ActiveRecord::Migration[5.0]
def change
add_column :accounts, :header_remote_url, :string, null: false, default: ''

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class AddLowercaseIndexToAccounts < ActiveRecord::Migration[5.0]
def up
execute 'CREATE INDEX index_accounts_on_username_and_domain_lower ON accounts (lower(username), lower(domain))'

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class ChangePrimaryKeyToBigintOnStatuses < ActiveRecord::Migration[5.0]
def change
change_column :statuses, :id, :bigint

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class AddSearchIndexToTags < ActiveRecord::Migration[5.0]
def up
execute 'CREATE INDEX hashtag_search_index ON tags USING gin(to_tsvector(\'simple\', tags.name));'

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class AddCounterCaches < ActiveRecord::Migration[5.0]
def change
add_column :statuses, :favourites_count, :integer, null: false, default: 0

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class CreateImports < ActiveRecord::Migration[5.0]
def change
create_table :imports do |t|

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class AddAttachmentDataToImports < ActiveRecord::Migration[4.2]
def self.up
change_table :imports do |t|

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class AddActionTakenByAccountIdToReports < ActiveRecord::Migration[5.0]
def change
add_column :reports, :action_taken_by_account_id, :integer

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class AddIndexOnMentionsStatusId < ActiveRecord::Migration[5.0]
def change
add_index :mentions, :status_id

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class AddNotificationsAndFavouritesIndices < ActiveRecord::Migration[5.0]
def change
add_index :notifications, [:activity_id, :activity_type]

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class AddLastWebfingeredAtToAccounts < ActiveRecord::Migration[5.0]
def change
add_column :accounts, :last_webfingered_at, :datetime

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class AddDeviseTwoFactorBackupableToUsers < ActiveRecord::Migration[5.0]
def change
add_column :users, :otp_backup_codes, :string, array: true

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class AddLanguageToStatuses < ActiveRecord::Migration[5.0]
def change
add_column :statuses, :language, :string, null: false, default: 'en'

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class AddIndexesToReportsForAccounts < ActiveRecord::Migration[5.0]
def change
add_index :reports, :account_id

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class AddAllowedLanguagesToUser < ActiveRecord::Migration[5.0]
def change
add_column :users, :allowed_languages, :string, array: true, default: [], null: false

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class CreateAccountDomainBlocks < ActiveRecord::Migration[5.0]
def change
create_table :account_domain_blocks do |t|

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class AddStatusIdIndexToStatusesTags < ActiveRecord::Migration[5.0]
def change
add_index :statuses_tags, :status_id

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class AddMediaAttachmentMeta < ActiveRecord::Migration[5.0]
def change
add_column :media_attachments, :file_meta, :json

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class AddOEmbedToPreviewCards < ActiveRecord::Migration[5.0]
def change
add_column :preview_cards, :type, :integer, default: 0, null: false

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class ReAddOwnerToApplication < ActiveRecord::Migration[5.0]
def change
add_column :oauth_applications, :owner_id, :integer, null: true

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class CreateConversations < ActiveRecord::Migration[5.0]
def change
create_table :conversations, id: :bigserial do |t|

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class AddConversationIdToStatuses < ActiveRecord::Migration[5.0]
def change
add_column :statuses, :conversation_id, :bigint, null: true, default: nil

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class OptimizeIndexSubscriptions < ActiveRecord::Migration[5.0]
def up
add_index :subscriptions, [:account_id, :callback_url], unique: true

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class CreateConversationMutes < ActiveRecord::Migration[5.0]
def change
create_table :conversation_mutes do |t|

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class AddIndexAccountsOnUri < ActiveRecord::Migration[5.0]
def change
add_index :accounts, :uri

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class ChangeLanguageFilterToOptOut < ActiveRecord::Migration[5.0]
def change
remove_index :users, :allowed_languages

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class AddIndexOnMediaAttachmentsAccountId < ActiveRecord::Migration[5.1]
def change
add_index :media_attachments, :account_id

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class AddForeignKeysForAccounts < ActiveRecord::Migration[5.1]
def change
add_foreign_key :statuses, :accounts, on_delete: :cascade

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class ChangeTagSearchIndexToBtree < ActiveRecord::Migration[5.1]
def up
remove_index :tags, name: :hashtag_search_index

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class RemoveDefaultLanguageFromStatuses < ActiveRecord::Migration[5.1]
def change
change_column :statuses, :language, :string, default: nil, null: true

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class AddStatusesIndexOnAccountIdId < ActiveRecord::Migration[5.1]
disable_ddl_transaction!

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class CreateSessionActivations < ActiveRecord::Migration[5.1]
def change
create_table :session_activations do |t|

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class AddDescriptionToSessionActivations < ActiveRecord::Migration[5.1]
def change
add_column :session_activations, :user_agent, :string, null: false, default: ''

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class AddAccessTokenIdToSessionActivations < ActiveRecord::Migration[5.1]
def change
add_column :session_activations, :access_token_id, :integer

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class FixNullBooleans < ActiveRecord::Migration[5.1]
def change
safety_assured do

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class MakeTagSearchCaseInsensitive < ActiveRecord::Migration[5.1]
def up
remove_index :tags, name: :hashtag_search_index

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class CreateWebPushSubscriptions < ActiveRecord::Migration[5.1]
def change
create_table :web_push_subscriptions do |t|

Some files were not shown because too many files have changed in this diff Show more