about summary refs log tree commit diff
path: root/db/migrate
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2018-08-11 15:28:06 +0200
committerGitHub <noreply@github.com>2018-08-11 15:28:06 +0200
commitd787bcdeb1570e4d8d67f326dadaf321a6854e06 (patch)
treefa23a187b16bf07635312a7791013aacfc2c4474 /db/migrate
parent03afc365d530e6d57754ae9dbbdbd0c56431ee02 (diff)
parent7067b64de33f9cd491e97329df266fde5fb49e42 (diff)
Merge pull request #630 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'db/migrate')
-rw-r--r--db/migrate/20180808175627_create_account_pins.rb12
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