diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2018-08-09 09:56:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-09 09:56:53 +0200 |
commit | f2404de871f0bdfda5c9aeeeb4c6c4d10a8da8ab (patch) | |
tree | f45577d1fe26ea56f7323b940f506f8875d7344e /db/migrate | |
parent | 80176a3814abad7f5c9023f97b5d4d82b73c089d (diff) |
Public profile endorsements (accounts picked by profile owner) (#8146)
Diffstat (limited to 'db/migrate')
-rw-r--r-- | db/migrate/20180808175627_create_account_pins.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/db/migrate/20180808175627_create_account_pins.rb b/db/migrate/20180808175627_create_account_pins.rb new file mode 100644 index 000000000..43d8185be --- /dev/null +++ b/db/migrate/20180808175627_create_account_pins.rb @@ -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 |