about summary refs log tree commit diff
path: root/db/migrate/20160221003621_create_follows.rb
diff options
context:
space:
mode:
Diffstat (limited to 'db/migrate/20160221003621_create_follows.rb')
-rw-r--r--db/migrate/20160221003621_create_follows.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/db/migrate/20160221003621_create_follows.rb b/db/migrate/20160221003621_create_follows.rb
new file mode 100644
index 000000000..afec3dee0
--- /dev/null
+++ b/db/migrate/20160221003621_create_follows.rb
@@ -0,0 +1,12 @@
+class CreateFollows < ActiveRecord::Migration
+  def change
+    create_table :follows do |t|
+      t.integer :account_id, null: false
+      t.integer :target_account_id, null: false
+
+      t.timestamps null: false
+    end
+
+    add_index :follows, [:account_id, :target_account_id], unique: true
+  end
+end