main
 1# frozen_string_literal: true
 2
 3class CreateUserSessions < ActiveRecord::Migration[5.2]
 4  def change
 5    create_table :user_sessions, id: :uuid do |t|
 6      t.references :user, foreign_key: true, type: :uuid
 7      t.string :key
 8      t.string :ip
 9      t.text :user_agent
10      t.datetime :sudo_enabled_at
11      t.datetime :accessed_at
12      t.datetime :revoked_at
13
14      t.timestamps
15    end
16    add_index :user_sessions, :key, unique: true
17  end
18end