mirror of
https://github.com/glitch-soc/mastodon.git
synced 2026-03-29 03:00:33 +02:00
Add support for multiple keypairs for remote accounts (#38279)
This commit is contained in:
20
db/migrate/20260323105645_create_keypairs.rb
Normal file
20
db/migrate/20260323105645_create_keypairs.rb
Normal file
@@ -0,0 +1,20 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class CreateKeypairs < ActiveRecord::Migration[8.0]
|
||||
def change
|
||||
create_table :keypairs do |t|
|
||||
t.references :account, null: false, foreign_key: { on_delete: :cascade }
|
||||
|
||||
t.string :uri, null: false
|
||||
t.integer :type, null: false
|
||||
t.string :public_key, null: false
|
||||
t.string :private_key
|
||||
t.datetime :expires_at
|
||||
t.boolean :revoked, default: false, null: false
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
add_index :keypairs, :uri, unique: true
|
||||
end
|
||||
end
|
||||
17
db/schema.rb
17
db/schema.rb
@@ -10,7 +10,7 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema[8.1].define(version: 2026_03_19_142348) do
|
||||
ActiveRecord::Schema[8.1].define(version: 2026_03_23_105645) do
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "pg_catalog.plpgsql"
|
||||
|
||||
@@ -683,6 +683,20 @@ ActiveRecord::Schema[8.1].define(version: 2026_03_19_142348) do
|
||||
t.index ["ip"], name: "index_ip_blocks_on_ip", unique: true
|
||||
end
|
||||
|
||||
create_table "keypairs", force: :cascade do |t|
|
||||
t.bigint "account_id", null: false
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "expires_at"
|
||||
t.string "private_key"
|
||||
t.string "public_key", null: false
|
||||
t.boolean "revoked", default: false, null: false
|
||||
t.integer "type", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.string "uri", null: false
|
||||
t.index ["account_id"], name: "index_keypairs_on_account_id"
|
||||
t.index ["uri"], name: "index_keypairs_on_uri", unique: true
|
||||
end
|
||||
|
||||
create_table "list_accounts", force: :cascade do |t|
|
||||
t.bigint "account_id", null: false
|
||||
t.bigint "follow_id"
|
||||
@@ -1492,6 +1506,7 @@ ActiveRecord::Schema[8.1].define(version: 2026_03_19_142348) do
|
||||
add_foreign_key "identities", "users", name: "fk_bea040f377", on_delete: :cascade
|
||||
add_foreign_key "instance_moderation_notes", "accounts", on_delete: :cascade
|
||||
add_foreign_key "invites", "users", on_delete: :cascade
|
||||
add_foreign_key "keypairs", "accounts", on_delete: :cascade
|
||||
add_foreign_key "list_accounts", "accounts", on_delete: :cascade
|
||||
add_foreign_key "list_accounts", "follow_requests", on_delete: :cascade
|
||||
add_foreign_key "list_accounts", "follows", on_delete: :cascade
|
||||
|
||||
Reference in New Issue
Block a user