Class: CreateDigestEmailGroups

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

Class Method Summary collapse

Class Method Details

.downObject



18
19
20
21
# File 'lib/generators/digest_notifier/templates/create_digest_email_groups.rb', line 18

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

.upObject



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/generators/digest_notifier/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_class
    t.integer  :sent_email_count   , :default => 0
    t.integer  :pending_email_count, :default => 0
    t.datetime :last_run_at
    t.string   :recipients
    t.string   :description

    t.timestamps
  end

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