Sha256: d51049d293d065fce6d4deb12ceaac0fe41924c0433101c570708478128946ad

Contents?: true

Size: 506 Bytes

Versions: 3

Compression:

Stored size: 506 Bytes

Contents

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

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

      # optional
      # feel free to remove
      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

3 entries across 3 versions & 1 rubygems

Version Path
ahoy_email-0.1.2 lib/generators/ahoy_email/templates/install.rb
ahoy_email-0.1.1 lib/generators/ahoy_email/templates/install.rb
ahoy_email-0.1.0 lib/generators/ahoy_email/templates/install.rb