diff options
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20161113184239_create_user_chat_names_table.rb | 15 | ||||
-rw-r--r-- | db/schema.rb | 11 |
2 files changed, 14 insertions, 12 deletions
diff --git a/db/migrate/20161113184239_create_user_chat_names_table.rb b/db/migrate/20161113184239_create_user_chat_names_table.rb index f9ab2adf2a9..1e138fba202 100644 --- a/db/migrate/20161113184239_create_user_chat_names_table.rb +++ b/db/migrate/20161113184239_create_user_chat_names_table.rb @@ -5,13 +5,14 @@ class CreateUserChatNamesTable < ActiveRecord::Migration def change create_table :chat_names do |t| - t.integer "user_id", null: false - t.integer "service_id", null: false - t.string "team_id" - t.string "team_domain" - t.string "chat_id" - t.string "chat_name" - t.timestamps + t.integer :user_id, null: false + t.integer :service_id, null: false + t.string :team_id, null: false + t.string :team_domain + t.string :chat_id, null: false + t.string :chat_name + t.datetime :used_at + t.timestamps null: false end add_index :chat_names, [:user_id, :service_id], unique: true diff --git a/db/schema.rb b/db/schema.rb index 5f25f0a305f..1c1a7a37096 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -152,15 +152,16 @@ ActiveRecord::Schema.define(version: 20161113184239) do create_table "chat_names", force: :cascade do |t| t.integer "user_id", null: false t.integer "service_id", null: false - t.string "team_id" + t.string "team_id", null: false t.string "team_domain" - t.string "chat_id" + t.string "chat_id", null: false t.string "chat_name" - t.datetime "created_at" - t.datetime "updated_at" + t.datetime "used_at" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end - add_index "chat_names", ["service_id", "team_id", "user_id"], name: "index_chat_names_on_service_id_and_team_id_and_user_id", unique: true, using: :btree + add_index "chat_names", ["service_id", "team_id", "chat_id"], name: "index_chat_names_on_service_id_and_team_id_and_chat_id", unique: true, using: :btree add_index "chat_names", ["user_id", "service_id"], name: "index_chat_names_on_user_id_and_service_id", unique: true, using: :btree create_table "ci_application_settings", force: :cascade do |t| |