1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: AGPL-3.0
5 class CreateApiClientAuthorizations < ActiveRecord::Migration
7 create_table :api_client_authorizations do |t|
8 t.string :api_token, :null => false
9 t.references :api_client, :null => false
10 t.references :user, :null => false
11 t.string :created_by_ip_address
12 t.string :last_used_by_ip_address
13 t.datetime :last_used_at
14 t.datetime :expires_at
18 add_index :api_client_authorizations, :api_token, :unique => true
19 add_index :api_client_authorizations, :api_client_id
20 add_index :api_client_authorizations, :user_id
21 add_index :api_client_authorizations, :expires_at