Class: CreateApicassoTables

Inherits:
Object
  • Object
show all
Defined in:
lib/generators/apicasso/install/templates/create_apicasso_tables.rb

Instance Method Summary collapse

Instance Method Details

#changeObject



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/generators/apicasso/install/templates/create_apicasso_tables.rb', line 2

def change
  execute <<-SQL
    CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
  SQL
  create_table :apicasso_keys, id: :uuid do |t|
    t.json :scope
    t.integer :scope_type
    t.json :request_limiting
    t.text :token
    t.datetime :deleted_at
    t.timestamps null: false
  end
  create_table :apicasso_requests, id: :uuid do |t|
    t.text :api_key_id
    t.json :object
    t.timestamps null: false
  end
end