Sha256: 68ac610c2584d05848a02e0dfb2b2bfbc8ecc0c0975ea012c4fce972c0688321

Contents?: true

Size: 294 Bytes

Versions: 15

Compression:

Stored size: 294 Bytes

Contents

class RemoveLogin < ActiveRecord::Migration
  def self.up
    Reader.reset_column_information
    Reader.all.each do |r|
      r.nickname ||= r.login
      r.save if r.changed?
    end
    remove_column :readers, :login
  end

  def self.down
    add_column :readers, :login, :string
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
radiant-reader-extension-3.0.38 db/migrate/20111013203306_remove_login.rb
radiant-reader-extension-3.0.37 db/migrate/20111013203306_remove_login.rb
radiant-reader-extension-3.0.36 db/migrate/20111013203306_remove_login.rb
radiant-reader-extension-3.0.35 db/migrate/20111013203306_remove_login.rb
radiant-reader-extension-3.0.33 db/migrate/20111013203306_remove_login.rb
radiant-reader-extension-3.0.32 db/migrate/20111013203306_remove_login.rb
radiant-reader-extension-3.0.31 db/migrate/20111013203306_remove_login.rb
radiant-reader-extension-3.0.30 db/migrate/20111013203306_remove_login.rb
radiant-reader-extension-3.0.29 db/migrate/20111013203306_remove_login.rb
radiant-reader-extension-3.0.28 db/migrate/20111013203306_remove_login.rb
radiant-reader-extension-3.0.27 db/migrate/20111013203306_remove_login.rb
radiant-reader-extension-3.0.26 db/migrate/20111013203306_remove_login.rb
radiant-reader-extension-3.0.25 db/migrate/20111013203306_remove_login.rb
radiant-reader-extension-3.0.24 db/migrate/20111013203306_remove_login.rb
radiant-reader-extension-3.0.23 db/migrate/20111013203306_remove_login.rb