Class: CreateDigestEmailGroupss

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

Class Method Summary collapse

Class Method Details

.downObject



16
17
18
19
# File 'lib/generators/digest_email/templates/create_digest_email_groups.rb', line 16

def self.down
  remove_index :digest_email_groups, [:mailer_name, :method_name]
  drop_table   :digest_email_groups
end

.upObject



2
3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/generators/digest_email/templates/create_digest_email_groups.rb', line 2

def self.up
  create_table :digest_email_groups do |t|
    t.string   :method_name
    t.string   :mailer_name
    t.integer  :sent_email_count   , :default => 0
    t.integer  :pending_email_count, :default => 0
    t.datetime :last_run_at

    t.timestamps
  end

  add_index :digest_email_groups, [:mailer_name, :method_name]
end