1 class CreateApiClientAuthorizations < ActiveRecord::Migration
3 create_table :api_client_authorizations do |t|
4 t.string :api_token, :null => false
5 t.references :api_client, :null => false
6 t.references :user, :null => false
7 t.string :created_by_ip_address
8 t.string :last_used_by_ip_address
9 t.datetime :last_used_at
10 t.datetime :expires_at
14 add_index :api_client_authorizations, :api_token, :unique => true
15 add_index :api_client_authorizations, :api_client_id
16 add_index :api_client_authorizations, :user_id
17 add_index :api_client_authorizations, :expires_at