Class: AddRpush::AddAdm

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

Defined Under Namespace

Modules: Rapns

Class Method Summary collapse

Class Method Details

.downObject


295
296
297
298
299
300
301
302
# File 'lib/generators/templates/add_rpush.rb', line 295

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


288
289
290
291
292
293
# File 'lib/generators/templates/add_rpush.rb', line 288

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