mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-15 16:59:41 +00:00
Merge commit 'b33f9ea60338a78dde2fb7fe3f083c2ffaafcf1f' into glitch-soc/merge-upstream
This commit is contained in:
20
db/migrate/20250411094808_create_quotes.rb
Normal file
20
db/migrate/20250411094808_create_quotes.rb
Normal file
@@ -0,0 +1,20 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class CreateQuotes < ActiveRecord::Migration[8.0]
|
||||
def change
|
||||
create_table :quotes do |t|
|
||||
t.belongs_to :account, foreign_key: { on_delete: :cascade }, index: false, null: false
|
||||
t.belongs_to :status, foreign_key: { on_delete: :cascade }, index: { unique: true }, null: false
|
||||
t.belongs_to :quoted_status, foreign_key: { to_table: :statuses, on_delete: :nullify }, null: true
|
||||
t.belongs_to :quoted_account, foreign_key: { to_table: :accounts, on_delete: :nullify }, null: true
|
||||
t.integer :state, null: false, default: 0
|
||||
t.string :approval_uri, index: { where: 'approval_uri IS NOT NULL' }
|
||||
t.string :activity_uri, index: { unique: true, where: 'activity_uri IS NOT NULL' }
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
# Can be used in the future to e.g. bulk-reject quotes from blocked accounts
|
||||
add_index :quotes, [:account_id, :quoted_account_id]
|
||||
end
|
||||
end
|
||||
7
db/migrate/20250411095859_add_quote_id_to_status_edit.rb
Normal file
7
db/migrate/20250411095859_add_quote_id_to_status_edit.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddQuoteIdToStatusEdit < ActiveRecord::Migration[8.0]
|
||||
def change
|
||||
add_column :status_edits, :quote_id, :bigint, null: true
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user