Class: CreateApnNotifications

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/generators/apn_on_rails/install/templates/002_create_apn_notifications.rb

Overview

:nodoc:

Class Method Summary collapse

Class Method Details

.downObject



19
20
21
# File 'lib/generators/apn_on_rails/install/templates/002_create_apn_notifications.rb', line 19

def self.down
  drop_table :apn_notifications
end

.upObject



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/generators/apn_on_rails/install/templates/002_create_apn_notifications.rb', line 3

def self.up

  create_table :apn_notifications do |t|
    t.integer :device_id, :null => false
    t.integer :errors_nb, :default => 0 # used for storing errors from apple feedbacks
    t.string :device_language, :size => 5 # if you don't want to send localized strings
    t.string :sound
    t.string :alert, :size => 150
    t.integer :badge
    t.datetime :sent_at
    t.timestamps
  end
  
  add_index :apn_notifications, :device_id
end