Public profile endorsements (accounts picked by profile owner) (#8146)
This commit is contained in:
parent
80176a3814
commit
f2404de871
21 changed files with 298 additions and 6 deletions
12
db/migrate/20180808175627_create_account_pins.rb
Normal file
12
db/migrate/20180808175627_create_account_pins.rb
Normal file
|
@ -0,0 +1,12 @@
|
|||
class CreateAccountPins < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
create_table :account_pins do |t|
|
||||
t.belongs_to :account, foreign_key: { on_delete: :cascade }
|
||||
t.belongs_to :target_account, foreign_key: { on_delete: :cascade, to_table: :accounts }
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
add_index :account_pins, [:account_id, :target_account_id], unique: true
|
||||
end
|
||||
end
|
16
db/schema.rb
16
db/schema.rb
|
@ -10,7 +10,7 @@
|
|||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 2018_07_11_152640) do
|
||||
ActiveRecord::Schema.define(version: 2018_08_08_175627) do
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "plpgsql"
|
||||
|
@ -33,6 +33,16 @@ ActiveRecord::Schema.define(version: 2018_07_11_152640) do
|
|||
t.index ["target_account_id"], name: "index_account_moderation_notes_on_target_account_id"
|
||||
end
|
||||
|
||||
create_table "account_pins", force: :cascade do |t|
|
||||
t.bigint "account_id"
|
||||
t.bigint "target_account_id"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.index ["account_id", "target_account_id"], name: "index_account_pins_on_account_id_and_target_account_id", unique: true
|
||||
t.index ["account_id"], name: "index_account_pins_on_account_id"
|
||||
t.index ["target_account_id"], name: "index_account_pins_on_target_account_id"
|
||||
end
|
||||
|
||||
create_table "accounts", force: :cascade do |t|
|
||||
t.string "username", default: "", null: false
|
||||
t.string "domain"
|
||||
|
@ -149,9 +159,9 @@ ActiveRecord::Schema.define(version: 2018_07_11_152640) do
|
|||
t.text "phrase", default: "", null: false
|
||||
t.string "context", default: [], null: false, array: true
|
||||
t.boolean "irreversible", default: false, null: false
|
||||
t.boolean "whole_word", default: true, null: false
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.boolean "whole_word", default: true, null: false
|
||||
t.index ["account_id"], name: "index_custom_filters_on_account_id"
|
||||
end
|
||||
|
||||
|
@ -575,6 +585,8 @@ ActiveRecord::Schema.define(version: 2018_07_11_152640) do
|
|||
add_foreign_key "account_domain_blocks", "accounts", name: "fk_206c6029bd", on_delete: :cascade
|
||||
add_foreign_key "account_moderation_notes", "accounts"
|
||||
add_foreign_key "account_moderation_notes", "accounts", column: "target_account_id"
|
||||
add_foreign_key "account_pins", "accounts", column: "target_account_id", on_delete: :cascade
|
||||
add_foreign_key "account_pins", "accounts", on_delete: :cascade
|
||||
add_foreign_key "accounts", "accounts", column: "moved_to_account_id", on_delete: :nullify
|
||||
add_foreign_key "admin_action_logs", "accounts", on_delete: :cascade
|
||||
add_foreign_key "backups", "users", on_delete: :nullify
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue