You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
asciinema.org/db/migrate/20141005144556_set_temporar...

8 lines
288 B
Ruby

class SetTemporaryUsernameOnUsers < ActiveRecord::Migration
def change
change_column :users, :username, :string, null: true
execute "UPDATE users SET temporary_username = username WHERE dummy IS TRUE"
execute "UPDATE users SET username = NULL WHERE dummy IS TRUE"
end
end