Add initial support for ingesting and verifying remote quote posts (#34370)
This commit is contained in:
parent
a324edabdf
commit
df2611a10f
33 changed files with 1643 additions and 22 deletions
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
|
Loading…
Add table
Add a link
Reference in a new issue