1
0
Fork 0
mirror of https://github.com/mastodon/mastodon.git synced 2024-08-20 21:08:15 -07:00
This commit is contained in:
Matt Jankowski 2024-07-31 14:07:11 +00:00 committed by GitHub
commit 2cbc499b79
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
21 changed files with 26 additions and 18 deletions

View file

@ -2,3 +2,7 @@ inherit_from: ../../.rubocop.yml
Naming/VariableNumber: Naming/VariableNumber:
CheckSymbols: false CheckSymbols: false
Rails/ThreeStateBooleanColumn:
Include:
- '*.rb'

View file

@ -2,6 +2,6 @@
class AddAdminToUsers < ActiveRecord::Migration[4.2] class AddAdminToUsers < ActiveRecord::Migration[4.2]
def change def change
add_column :users, :admin, :boolean, default: false add_column :users, :admin, :boolean, default: false # rubocop:disable Rails/ThreeStateBooleanColumn
end end
end end

View file

@ -2,6 +2,6 @@
class AddSensitiveToStatuses < ActiveRecord::Migration[5.0] class AddSensitiveToStatuses < ActiveRecord::Migration[5.0]
def change def change
add_column :statuses, :sensitive, :boolean, default: false add_column :statuses, :sensitive, :boolean, default: false # rubocop:disable Rails/ThreeStateBooleanColumn
end end
end end

View file

@ -2,6 +2,6 @@
class AddRejectMediaToDomainBlocks < ActiveRecord::Migration[5.0] class AddRejectMediaToDomainBlocks < ActiveRecord::Migration[5.0]
def change def change
add_column :domain_blocks, :reject_media, :boolean add_column :domain_blocks, :reject_media, :boolean # rubocop:disable Rails/ThreeStateBooleanColumn
end end
end end

View file

@ -7,7 +7,7 @@ class AddDeviseTwoFactorToUsers < ActiveRecord::Migration[5.0]
t.column :encrypted_otp_secret_iv, :string t.column :encrypted_otp_secret_iv, :string
t.column :encrypted_otp_secret_salt, :string t.column :encrypted_otp_secret_salt, :string
t.column :consumed_timestep, :integer t.column :consumed_timestep, :integer
t.column :otp_required_for_login, :boolean t.column :otp_required_for_login, :boolean # rubocop:disable Rails/ThreeStateBooleanColumn
end end
end end
end end

View file

@ -2,7 +2,7 @@
class AddReplyToStatuses < ActiveRecord::Migration[5.0] class AddReplyToStatuses < ActiveRecord::Migration[5.0]
def up def up
add_column :statuses, :reply, :boolean, nil: false, default: false add_column :statuses, :reply, :boolean, default: false # rubocop:disable Rails/ThreeStateBooleanColumn
Status.unscoped.update_all('reply = (in_reply_to_id IS NOT NULL)') Status.unscoped.update_all('reply = (in_reply_to_id IS NOT NULL)')
end end

View file

@ -5,7 +5,7 @@ class CreateImports < ActiveRecord::Migration[5.0]
create_table :imports do |t| create_table :imports do |t|
t.integer :account_id, null: false t.integer :account_id, null: false
t.integer :type, null: false t.integer :type, null: false
t.boolean :approved t.boolean :approved # rubocop:disable Rails/ThreeStateBooleanColumn
t.timestamps t.timestamps
end end

View file

@ -2,6 +2,6 @@
class AddLocalToStatuses < ActiveRecord::Migration[5.1] class AddLocalToStatuses < ActiveRecord::Migration[5.1]
def change def change
add_column :statuses, :local, :boolean, null: true, default: nil add_column :statuses, :local, :boolean, null: true, default: nil # rubocop:disable Rails/ThreeStateBooleanColumn
end end
end end

View file

@ -2,6 +2,6 @@
class AddDiscoverableToAccounts < ActiveRecord::Migration[5.2] class AddDiscoverableToAccounts < ActiveRecord::Migration[5.2]
def change def change
add_column :accounts, :discoverable, :boolean add_column :accounts, :discoverable, :boolean # rubocop:disable Rails/ThreeStateBooleanColumn
end end
end end

View file

@ -2,6 +2,6 @@
class AddByModeratorToTombstone < ActiveRecord::Migration[5.2] class AddByModeratorToTombstone < ActiveRecord::Migration[5.2]
def change def change
add_column :tombstones, :by_moderator, :boolean add_column :tombstones, :by_moderator, :boolean # rubocop:disable Rails/ThreeStateBooleanColumn
end end
end end

View file

@ -4,9 +4,11 @@ class AddCapabilitiesToTags < ActiveRecord::Migration[5.2]
def change def change
safety_assured do safety_assured do
change_table(:tags, bulk: true) do |t| change_table(:tags, bulk: true) do |t|
# rubocop:disable Rails/ThreeStateBooleanColumn
t.column :usable, :boolean t.column :usable, :boolean
t.column :trendable, :boolean t.column :trendable, :boolean
t.column :listable, :boolean t.column :listable, :boolean
# rubocop:enable Rails/ThreeStateBooleanColumn
t.column :reviewed_at, :datetime t.column :reviewed_at, :datetime
t.column :requested_review_at, :datetime t.column :requested_review_at, :datetime
end end

View file

@ -2,6 +2,6 @@
class AddHideCollectionsToAccounts < ActiveRecord::Migration[5.2] class AddHideCollectionsToAccounts < ActiveRecord::Migration[5.2]
def change def change
add_column :accounts, :hide_collections, :boolean add_column :accounts, :hide_collections, :boolean # rubocop:disable Rails/ThreeStateBooleanColumn
end end
end end

View file

@ -2,6 +2,6 @@
class AddForwardedToReports < ActiveRecord::Migration[5.2] class AddForwardedToReports < ActiveRecord::Migration[5.2]
def change def change
add_column :reports, :forwarded, :boolean add_column :reports, :forwarded, :boolean # rubocop:disable Rails/ThreeStateBooleanColumn
end end
end end

View file

@ -6,7 +6,7 @@ class CreateLoginActivities < ActiveRecord::Migration[6.1]
t.belongs_to :user, null: false, foreign_key: { on_delete: :cascade } t.belongs_to :user, null: false, foreign_key: { on_delete: :cascade }
t.string :authentication_method t.string :authentication_method
t.string :provider t.string :provider
t.boolean :success t.boolean :success # rubocop:disable Rails/ThreeStateBooleanColumn
t.string :failure_reason t.string :failure_reason
t.inet :ip t.inet :ip
t.string :user_agent t.string :user_agent

View file

@ -2,6 +2,6 @@
class AddSkipSignInTokenToUsers < ActiveRecord::Migration[6.1] class AddSkipSignInTokenToUsers < ActiveRecord::Migration[6.1]
def change def change
add_column :users, :skip_sign_in_token, :boolean add_column :users, :skip_sign_in_token, :boolean # rubocop:disable Rails/ThreeStateBooleanColumn
end end
end end

View file

@ -5,7 +5,7 @@ class CreatePreviewCardProviders < ActiveRecord::Migration[6.1]
create_table :preview_card_providers do |t| create_table :preview_card_providers do |t|
t.string :domain, null: false, default: '', index: { unique: true } t.string :domain, null: false, default: '', index: { unique: true }
t.attachment :icon t.attachment :icon
t.boolean :trendable t.boolean :trendable # rubocop:disable Rails/ThreeStateBooleanColumn
t.datetime :reviewed_at t.datetime :reviewed_at
t.datetime :requested_review_at t.datetime :requested_review_at
t.timestamps t.timestamps

View file

@ -2,6 +2,6 @@
class AddTrendableToPreviewCards < ActiveRecord::Migration[6.1] class AddTrendableToPreviewCards < ActiveRecord::Migration[6.1]
def change def change
add_column :preview_cards, :trendable, :boolean add_column :preview_cards, :trendable, :boolean # rubocop:disable Rails/ThreeStateBooleanColumn
end end
end end

View file

@ -4,7 +4,7 @@ class AddTrendableToAccounts < ActiveRecord::Migration[6.1]
def change def change
safety_assured do safety_assured do
change_table(:accounts, bulk: true) do |t| change_table(:accounts, bulk: true) do |t|
t.column :trendable, :boolean t.column :trendable, :boolean # rubocop:disable Rails/ThreeStateBooleanColumn
t.column :reviewed_at, :datetime t.column :reviewed_at, :datetime
t.column :requested_review_at, :datetime t.column :requested_review_at, :datetime
end end

View file

@ -2,6 +2,6 @@
class AddTrendableToStatuses < ActiveRecord::Migration[6.1] class AddTrendableToStatuses < ActiveRecord::Migration[6.1]
def change def change
add_column :statuses, :trendable, :boolean add_column :statuses, :trendable, :boolean # rubocop:disable Rails/ThreeStateBooleanColumn
end end
end end

View file

@ -7,7 +7,7 @@ class AddOrderedMediaAttachmentIdsToStatusEdits < ActiveRecord::Migration[6.1]
t.column :ordered_media_attachment_ids, :bigint, array: true t.column :ordered_media_attachment_ids, :bigint, array: true
t.column :media_descriptions, :text, array: true t.column :media_descriptions, :text, array: true
t.column :poll_options, :string, array: true t.column :poll_options, :string, array: true
t.column :sensitive, :boolean t.column :sensitive, :boolean # rubocop:disable Rails/ThreeStateBooleanColumn
end end
end end
end end

View file

@ -14,8 +14,10 @@ class CreateSeveredRelationships < ActiveRecord::Migration[7.0]
t.integer :direction, null: false t.integer :direction, null: false
# Those attributes are carried over from the `follows` table # Those attributes are carried over from the `follows` table
# rubocop:disable Rails/ThreeStateBooleanColumn
t.boolean :show_reblogs t.boolean :show_reblogs
t.boolean :notify t.boolean :notify
# rubocop:enable Rails/ThreeStateBooleanColumn
t.string :languages, array: true t.string :languages, array: true
t.timestamps t.timestamps