Sha256: 867af8aa52cb199bd782af3d88aa94f710e7a84c4e0a99e48002e59cb1f5902b

Contents?: true

Size: 445 Bytes

Versions: 7

Compression:

Stored size: 445 Bytes

Contents

class AddCurupiraToUsers < ActiveRecord::Migration
  def self.up
    change_table :users  do |t|
<% @user_columns.values.each do |column| -%>
      <%= column %>
<% end -%>
    end
<% @user_indexes.values.each do |index| -%>
    <%= index %>
<% end -%>
  end

  def self.down
    change_table :users do |t|
<% if @user_columns.any? -%>
      t.remove <%= @user_columns.keys.map { |column| ":#{column}" }.join(",") %>
<% end -%>
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
curupira-0.1.7 lib/generators/curupira/templates/db/migrate/add_curupira_to_users.rb
curupira-0.1.6 lib/generators/curupira/templates/db/migrate/add_curupira_to_users.rb
curupira-0.1.4 lib/generators/curupira/templates/db/migrate/add_curupira_to_users.rb
curupira-0.1.3 lib/generators/curupira/templates/db/migrate/add_curupira_to_users.rb
curupira-0.1.2 lib/generators/curupira/templates/db/migrate/add_curupira_to_users.rb
curupira-0.1.1 lib/generators/curupira/templates/db/migrate/add_curupira_to_users.rb
curupira-0.1.0 lib/generators/curupira/templates/db/migrate/add_curupira_to_users.rb