Merge commit '15fd712464
' into kb_migration
This commit is contained in:
commit
3a1a6ba39e
289 changed files with 1339 additions and 1337 deletions
|
@ -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
|
||||
|
|
|
@ -2,14 +2,14 @@ class RejectFollowingBlockedUsers < ActiveRecord::Migration[5.2]
|
|||
disable_ddl_transaction!
|
||||
|
||||
def up
|
||||
blocked_follows = Follow.find_by_sql(<<-SQL)
|
||||
blocked_follows = Follow.find_by_sql(<<-SQL.squish)
|
||||
select f.* from follows f
|
||||
inner join blocks b on
|
||||
f.account_id = b.target_account_id and
|
||||
f.target_account_id = b.account_id
|
||||
SQL
|
||||
|
||||
domain_blocked_follows = Follow.find_by_sql(<<-SQL)
|
||||
domain_blocked_follows = Follow.find_by_sql(<<-SQL.squish)
|
||||
select f.* from follows f
|
||||
inner join accounts following on f.account_id = following.id
|
||||
inner join account_domain_blocks b on
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class CreateEmojiReactions < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
create_table :emoji_reactions do |t|
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddEmojiReactionsToStatusStats < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
add_column :status_stats, :emoji_reactions, :string
|
||||
|
|
|
@ -1,6 +1,17 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddImageSizeToCustomEmojis < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
add_column :custom_emojis, :image_width, :integer
|
||||
add_column :custom_emojis, :image_height, :integer
|
||||
change_table :custom_emojis, bulk: true do |t|
|
||||
t.integer :image_width
|
||||
t.integer :image_height
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
change_table :custom_emojis, bulk: true do |t|
|
||||
t.remove :image_width
|
||||
t.remove :image_height
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddSearchabilityToStatuses < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
add_column :statuses, :searchability, :integer
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddSearchabilityToAccounts < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
add_column :accounts, :searchability, :integer, null: false, default: 0
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class ChangeSearchabilityDefaultValue < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
change_column_default :accounts, :searchability, from: 0, to: 2
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddEmojiReactionsCountToStatusStats < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
add_column :status_stats, :emoji_reactions_count, :integer, null: false, default: 0
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddMarkdownToStatuses < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
add_column :statuses, :markdown, :boolean, default: false
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddMarkdownToStatusEdits < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
add_column :status_edits, :markdown, :boolean, default: false
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddEmojiReactionsCountPerAccountToStatusStats < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
add_column :status_stats, :emoji_reaction_accounts_count, :integer, null: false, default: 0
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class CreateAntennas < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
create_table :antennas do |t|
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddDissubscribableToAccounts < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
add_column :antennas, :with_media_only, :boolean, null: false, default: false, index: true
|
||||
add_column :antennas, :with_media_only, :boolean, null: false, default: false
|
||||
add_index :antennas, :with_media_only
|
||||
add_column :accounts, :dissubscribable, :boolean, null: false, default: false
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,7 +1,19 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddExcludesToAntennas < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
add_column :antennas, :exclude_domains, :jsonb
|
||||
add_column :antennas, :exclude_accounts, :jsonb
|
||||
add_column :antennas, :exclude_tags, :jsonb
|
||||
change_table :antennas, bulk: true do |t|
|
||||
t.jsonb :exclude_domains
|
||||
t.jsonb :exclude_accounts
|
||||
t.jsonb :exclude_tags
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
change_table :antennas, bulk: true do |t|
|
||||
t.remove :exclude_domains
|
||||
t.remove :exclude_accounts
|
||||
t.remove :exclude_tags
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,10 +1,25 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddRejectSendingToDomainBlocks < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
add_column :domain_blocks, :reject_send_not_public_searchability, :boolean, null: false, default: false
|
||||
add_column :domain_blocks, :reject_send_unlisted_dissubscribable, :boolean, null: false, default: false
|
||||
add_column :domain_blocks, :reject_send_public_unlisted, :boolean, null: false, default: false
|
||||
add_column :domain_blocks, :reject_send_dissubscribable, :boolean, null: false, default: false
|
||||
add_column :domain_blocks, :reject_send_media, :boolean, null: false, default: false
|
||||
add_column :domain_blocks, :reject_send_sensitive, :boolean, null: false, default: false
|
||||
change_table :domain_blocks, bulk: true do |t|
|
||||
t.boolean :reject_send_not_public_searchability, null: false, default: false
|
||||
t.boolean :reject_send_unlisted_dissubscribable, null: false, default: false
|
||||
t.boolean :reject_send_public_unlisted, null: false, default: false
|
||||
t.boolean :reject_send_dissubscribable, null: false, default: false
|
||||
t.boolean :reject_send_media, null: false, default: false
|
||||
t.boolean :reject_send_sensitive, null: false, default: false
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
change_table :domain_blocks, bulk: true do |t|
|
||||
t.remove :reject_send_not_public_searchability
|
||||
t.remove :reject_send_unlisted_dissubscribable
|
||||
t.remove :reject_send_public_unlisted
|
||||
t.remove :reject_send_dissubscribable
|
||||
t.remove :reject_send_media
|
||||
t.remove :reject_send_sensitive
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,7 +1,19 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddSomeToDomainBlocks < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
add_column :domain_blocks, :reject_hashtag, :boolean, null: false, default: false
|
||||
add_column :domain_blocks, :reject_straight_follow, :boolean, null: false, default: false
|
||||
add_column :domain_blocks, :reject_new_follow, :boolean, null: false, default: false
|
||||
change_table :domain_blocks, bulk: true do |t|
|
||||
t.boolean :reject_hashtag, null: false, default: false
|
||||
t.boolean :reject_straight_follow, null: false, default: false
|
||||
t.boolean :reject_new_follow, null: false, default: false
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
change_table :domain_blocks, bulk: true do |t|
|
||||
t.remove :reject_hashtag
|
||||
t.remove :reject_straight_follow
|
||||
t.remove :reject_new_follow
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,6 +1,17 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddHiddenToDomainBlocks < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
add_column :domain_blocks, :hidden, :boolean, null: false, default: false
|
||||
add_column :domain_blocks, :hidden_anonymous, :boolean, null: false, default: false
|
||||
change_table :domain_blocks, bulk: true do |t|
|
||||
t.boolean :hidden, null: false, default: false
|
||||
t.boolean :hidden_anonymous, null: false, default: false
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
change_table :domain_blocks, bulk: true do |t|
|
||||
t.remove :hidden
|
||||
t.remove :hidden_anonymous
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddRejectInvalidSubscriptionToDomainBlocks < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
safety_assured do
|
||||
|
|
|
@ -2,7 +2,7 @@ class RemoveBoostsWideningAudience < ActiveRecord::Migration[5.2]
|
|||
disable_ddl_transaction!
|
||||
|
||||
def up
|
||||
public_boosts = Status.find_by_sql(<<-SQL)
|
||||
public_boosts = Status.find_by_sql(<<-SQL.squish)
|
||||
SELECT boost.id
|
||||
FROM statuses AS boost
|
||||
LEFT JOIN statuses AS boosted ON boost.reblog_of_id = boosted.id
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue