Sha256: 903ce3ac5e321db7b1bd2f0d6233c2dac7abae01a37b17c30f605645aff4652a

Contents?: true

Size: 546 Bytes

Versions: 6

Compression:

Stored size: 546 Bytes

Contents

class <%= migration_class_name %> < ActiveRecord::Migration
  def change
    create_table :ahoy_messages do |t|
      t.string :token

      # user
      t.text :to
      t.integer :user_id
      t.string :user_type

      # optional
      # feel free to remove
      t.string :mailer
      t.text :subject
      t.text :content

      # timestamps
      t.timestamp :sent_at
      t.timestamp :opened_at
      t.timestamp :clicked_at
    end

    add_index :ahoy_messages, [:token]
    add_index :ahoy_messages, [:user_id, :user_type]
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ahoy_email-0.2.2 lib/generators/ahoy_email/templates/install.rb
ahoy_email-0.2.1 lib/generators/ahoy_email/templates/install.rb
ahoy_email-0.2.0 lib/generators/ahoy_email/templates/install.rb
ahoy_email-0.1.5 lib/generators/ahoy_email/templates/install.rb
ahoy_email-0.1.4 lib/generators/ahoy_email/templates/install.rb
ahoy_email-0.1.3 lib/generators/ahoy_email/templates/install.rb