Sha256: 9d5c419d722e701149d771d9a71f799155c6db41418f49e34b47f3d0dfeedc4c

Contents?: true

Size: 312 Bytes

Versions: 9

Compression:

Stored size: 312 Bytes

Contents

class AddMailinglistidToUsers < ActiveRecord::Migration
  def self.up
    add_column :users, :mailinglist_id, :integer

    User.find_all.each do |u|
        u.mailinglist_id = Mailinglist.find_by_name(u.login).id
        u.save
    end
  end

  def self.down
    remove_column :users, :mailinglist_id
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
sugoi-mail-0.1.5 db/migrate/008_add_mailinglistid_to_users.rb
sugoi-mail-0.0.3 db/migrate/008_add_mailinglistid_to_users.rb
sugoi-mail-0.1.0 db/migrate/008_add_mailinglistid_to_users.rb
sugoi-mail-0.0.2 db/migrate/008_add_mailinglistid_to_users.rb
sugoi-mail-0.0.0 db/migrate/008_add_mailinglistid_to_users.rb
sugoi-mail-0.0.5 db/migrate/008_add_mailinglistid_to_users.rb
sugoi-mail-0.0.1 db/migrate/008_add_mailinglistid_to_users.rb
sugoi-mail-0.3.2 db/migrate/008_add_mailinglistid_to_users.rb
sugoi-mail-0.3.0 db/migrate/008_add_mailinglistid_to_users.rb