class CreateMailRotatorMailerStores < ActiveRecord::Migration def change create_table table_name do |t| t.string :name, null: false t.integer :limit, null: false, default: 1 t.integer :sent_count, null: false, default: 0 t.boolean :active, default: false t.timestamps null: false end add_index table_name, :name, unique: true end private def table_name MailRotator::MailerStore.table_name end end