Sha256: 60349406c6a087e2c94d0c9a4184c1c1c6cf190d3d29e514f8caa3a43c0f1d46

Contents?: true

Size: 612 Bytes

Versions: 7

Compression:

Stored size: 612 Bytes

Contents

class <%= "#{migration_name.classify.pluralize}" %> < <%= migration_class_name %>
  def change
  <% attributes_names.each do |attribute| %>
    add_column :<%= name.tableize %>, <%= ":#{attribute}_token" %>, :string, default: nil
    add_column :<%= name.tableize %>, <%= ":#{attribute}_created_at" %>, :timestamp, default: nil
    add_column :<%= name.tableize %>, <%= ":#{attribute}_sent_at" %>, :timestamp, default: nil
    add_column :<%= name.tableize %>, <%= ":#{attribute}_completed_at" %>, :timestamp, default: nil

    add_index :<%= name.tableize %>, <%= ":#{attribute}_token" %>
  <% end %>
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
token_master-1.1.0 lib/generators/rails/templates/migration.rb.erb
token_master-1.0.1 lib/generators/rails/templates/migration.rb.erb
token_master-1.0.0 lib/generators/rails/templates/migration.rb.erb
token_master-0.1.3 lib/generators/rails/templates/migration.rb.erb
token_master-0.1.2 lib/generators/rails/templates/migration.rb.erb
token_master-0.1.0 lib/generators/rails/templates/migration.rb.erb
token_master-0.0.1 lib/generators/rails/templates/migration.rb.erb