Add conversation-based forwarding for limited visibility statuses through bearcaps
This commit is contained in:
parent
52157fdcba
commit
7cd4ed7d42
26 changed files with 430 additions and 78 deletions
10
db/migrate/20200825232828_create_status_capability_tokens.rb
Normal file
10
db/migrate/20200825232828_create_status_capability_tokens.rb
Normal file
|
@ -0,0 +1,10 @@
|
|||
class CreateStatusCapabilityTokens < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
create_table :status_capability_tokens do |t|
|
||||
t.belongs_to :status, foreign_key: true
|
||||
t.string :token
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,7 @@
|
|||
class AddInboxUrlToConversations < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
add_column :conversations, :parent_status_id, :bigint, null: true, default: nil
|
||||
add_column :conversations, :parent_account_id, :bigint, null: true, default: nil
|
||||
add_column :conversations, :inbox_url, :string, null: true, default: nil
|
||||
end
|
||||
end
|
|
@ -0,0 +1,15 @@
|
|||
class ConversationIdsToTimestampIds < ActiveRecord::Migration[5.2]
|
||||
def up
|
||||
safety_assured do
|
||||
execute("ALTER TABLE conversations ALTER COLUMN id SET DEFAULT timestamp_id('conversations')")
|
||||
end
|
||||
|
||||
Mastodon::Snowflake.ensure_id_sequences_exist
|
||||
end
|
||||
|
||||
def down
|
||||
execute("LOCK conversations")
|
||||
execute("SELECT setval('conversations_id_seq', (SELECT MAX(id) FROM conversations))")
|
||||
execute("ALTER TABLE conversations ALTER COLUMN id SET DEFAULT nextval('conversations_id_seq')")
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue