Class: Devices

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/generators/acts_as_pushable/templates/migration/devices.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
20
# File 'lib/generators/acts_as_pushable/templates/migration/devices.rb', line 2

def change
  create_table :devices do |t|
    t.string :token
    t.integer :parent_id
    t.string :parent_type
    t.string :platform
    t.boolean :active, default: true
    t.datetime :valid_at
    t.datetime :invalidated_at
    t.datetime :deleted_at
    t.string :platform_version
    t.string :platform_type
    t.string :push_environment
    t.datetime :deactivated_at
    t.timestamps
  end

  add_index :devices, :token, unique: true
end