about summary refs log tree commit diff
path: root/db/migrate
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2019-08-06 13:55:54 -0500
committermultiple creatures <dev@multiple-creature.party>2019-08-06 13:55:54 -0500
commitda389a664b87bb131435f2ccb904c0754d5d1655 (patch)
tree79f6fe6b29f2c361f1c33aa9a811991892b2f0db /db/migrate
parent647ac0f86abb49b97c55229b70e9c06e943adc98 (diff)
added ability to link accounts with `account:link:token` + `account:link:add` & switch between them with `i:am`/`we:are` bangtags; remove links with `account:link:del:USERNAME` or `account:link:clear`; list links with `account:link:list`
Diffstat (limited to 'db/migrate')
-rw-r--r--db/migrate/20190805203816_create_linked_users.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/db/migrate/20190805203816_create_linked_users.rb b/db/migrate/20190805203816_create_linked_users.rb
new file mode 100644
index 000000000..36744fed6
--- /dev/null
+++ b/db/migrate/20190805203816_create_linked_users.rb
@@ -0,0 +1,12 @@
+class CreateLinkedUsers < ActiveRecord::Migration[5.2]
+  def change
+    create_table :linked_users do |t|
+      t.references :user, foreign_key: { on_delete: :cascade }
+      t.references :target_user, foreign_key: { to_table: 'users', on_delete: :cascade }
+
+      t.timestamps
+    end
+
+    add_index :linked_users , [:user_id, :target_user_id], :unique => true
+  end
+end