about summary refs log tree commit diff
path: root/db
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-11-04 19:12:59 +0100
committerEugen Rochko <eugen@zeonfederated.com>2016-11-04 19:12:59 +0100
commit62292797eccc5bcf47abae9f4daaa2c186660644 (patch)
treefb324996024317abc9605015845f7467508d5d73 /db
parent6471a548feadf34d65fb96660f958bf808331c8f (diff)
Adding hashtag model
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20161104173623_create_tags.rb11
-rw-r--r--db/schema.rb9
2 files changed, 19 insertions, 1 deletions
diff --git a/db/migrate/20161104173623_create_tags.rb b/db/migrate/20161104173623_create_tags.rb
new file mode 100644
index 000000000..d6831ff8f
--- /dev/null
+++ b/db/migrate/20161104173623_create_tags.rb
@@ -0,0 +1,11 @@
+class CreateTags < ActiveRecord::Migration[5.0]
+  def change
+    create_table :tags do |t|
+      t.string :name, null: false, default: ''
+
+      t.timestamps
+    end
+
+    add_index :tags, :name, unique: true
+  end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 0af5a6395..3d0182ba9 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -10,7 +10,7 @@
 #
 # It's strongly recommended that you check this file into your version control system.
 
-ActiveRecord::Schema.define(version: 20161027172456) do
+ActiveRecord::Schema.define(version: 20161104173623) do
 
   # These are extensions that must be enabled in order to support this database
   enable_extension "plpgsql"
@@ -170,6 +170,13 @@ ActiveRecord::Schema.define(version: 20161027172456) do
     t.index ["activity_id", "activity_type"], name: "index_stream_entries_on_activity_id_and_activity_type", using: :btree
   end
 
+  create_table "tags", force: :cascade do |t|
+    t.string   "name",       default: "", null: false
+    t.datetime "created_at",              null: false
+    t.datetime "updated_at",              null: false
+    t.index ["name"], name: "index_tags_on_name", unique: true, using: :btree
+  end
+
   create_table "users", force: :cascade do |t|
     t.string   "email",                  default: "",    null: false
     t.integer  "account_id",                             null: false