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



269
270
271
272
273
274
275
276
# File 'lib/generators/templates/add_rpush.rb', line 269

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



262
263
264
265
266
267
# File 'lib/generators/templates/add_rpush.rb', line 262

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