2019-05-03 06:17:27 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-08-31 12:06:56 +08:00
|
|
|
class AddUserApiKeys < ActiveRecord::Migration[4.2]
|
2016-08-15 15:58:33 +08:00
|
|
|
def change
|
|
|
|
create_table :user_api_keys do |t|
|
|
|
|
t.integer :user_id, null: false
|
|
|
|
t.string :client_id, null: false
|
|
|
|
t.string :key, null: false
|
|
|
|
t.string :application_name, null: false
|
|
|
|
t.boolean :read, null: false
|
|
|
|
t.boolean :write, null: false
|
|
|
|
t.boolean :push, null: false
|
|
|
|
t.string :push_url
|
2017-08-07 23:48:36 +08:00
|
|
|
t.timestamps null: false
|
2016-08-15 15:58:33 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
add_index :user_api_keys, [:key], unique: true
|
|
|
|
add_index :user_api_keys, [:user_id]
|
|
|
|
add_index :user_api_keys, [:client_id]
|
|
|
|
end
|
|
|
|
end
|