Class: AddAdm

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/generators/templates/add_adm.rb

Defined Under Namespace

Modules: Rapns

Class Method Summary collapse

Class Method Details

.downObject


15
16
17
18
19
20
21
22
# File 'lib/generators/templates/add_adm.rb', line 15

def self.down
  AddAdm::Rapns::Notification.where(type: 'Rapns::Adm::Notification').delete_all

  remove_column :rapns_apps, :client_id
  remove_column :rapns_apps, :client_secret
  remove_column :rapns_apps, :access_token
  remove_column :rapns_apps, :access_token_expiration
end

.upObject


8
9
10
11
12
13
# File 'lib/generators/templates/add_adm.rb', line 8

def self.up
  add_column :rapns_apps, :client_id, :string, null: true
  add_column :rapns_apps, :client_secret, :string, null: true
  add_column :rapns_apps, :access_token, :string, null: true
  add_column :rapns_apps, :access_token_expiration, :datetime, null: true
end