about summary refs log tree commit diff
path: root/db/migrate/20170917153509_create_custom_emojis.rb
diff options
context:
space:
mode:
Diffstat (limited to 'db/migrate/20170917153509_create_custom_emojis.rb')
-rw-r--r--db/migrate/20170917153509_create_custom_emojis.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/db/migrate/20170917153509_create_custom_emojis.rb b/db/migrate/20170917153509_create_custom_emojis.rb
new file mode 100644
index 000000000..4040c8312
--- /dev/null
+++ b/db/migrate/20170917153509_create_custom_emojis.rb
@@ -0,0 +1,13 @@
+class CreateCustomEmojis < ActiveRecord::Migration[5.1]
+  def change
+    create_table :custom_emojis do |t|
+      t.string :shortcode, null: false, default: ''
+      t.string :domain
+      t.attachment :image
+
+      t.timestamps
+    end
+
+    add_index :custom_emojis, [:shortcode, :domain], unique: true
+  end
+end