Class: CreateGcmDevices

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

Overview

:nodoc:

Class Method Summary collapse

Class Method Details

.downObject



13
14
15
# File 'lib/generators/templates/gcm_migrations/create_gcm_devices.rb', line 13

def self.down
  drop_table :gcm_devices
end

.upObject



2
3
4
5
6
7
8
9
10
11
# File 'lib/generators/templates/gcm_migrations/create_gcm_devices.rb', line 2

def self.up
  create_table :gcm_devices do |t|
    t.string :registration_id, :size => 120, :null => false
    t.datetime :last_registered_at

    t.timestamps
  end

  add_index :gcm_devices, :registration_id, :unique => true
end