Sha256: cd1bf3bc162cc43fcc87ce05deec1d7d28b5ca9ea6b99e406eec4cd65687b75f

Contents?: true

Size: 831 Bytes

Versions: 1

Compression:

Stored size: 831 Bytes

Contents

class CreateEmailAddresses < ActiveRecord::Migration
  def self.up
    create_table :email_addresses do |t|
      t.column :emailable_id, :integer, :null => false, :references => nil
      t.column :emailable_type, :string, :null => false
      t.column :spec, :string, :null => false, :limit => 382
      t.column :verification_code, :string, :limit => 40
      t.column :code_expiry, :datetime
      t.column :created_at, :timestamp, :null => false
      t.column :updated_at, :datetime, :null => false
    end
    add_index :email_addresses, :spec, :unique => true
    add_index :email_addresses, :verification_code, :unique => true
    
    PluginAWeek::Has::States.migrate_up(:email_addresses)
  end
  
  def self.down
    PluginAWeek::Has::States.migrate_down(:email_addresses)
    
    drop_table :email_addresses
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
has_emails-0.0.1 db/migrate/001_create_email_addresses.rb