Class: CreateAk4rApiKey

Inherits:
Object
  • Object
show all
Defined in:
lib/generators/templates/migration.rb

Class Method Summary collapse

Class Method Details

.downObject



16
17
18
# File 'lib/generators/templates/migration.rb', line 16

def self.down
  drop_table :ak4r_api_keys
end

.upObject



2
3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/generators/templates/migration.rb', line 2

def self.up
  create_table :ak4r_api_keys do |t|
    t.string :name
    t.string :prefix
    t.string :key_hash
    t.string :scopes, array: true
    t.timestamp :valid_until
    t.timestamps
  end

  add_index :ak4r_api_keys, :prefix
  add_index :ak4r_api_keys, :key_hash
end