asciinema.org/db/migrate/20141115172153_add_secret_token_to_asciicasts.rb

12 lines
330 B
Ruby
Raw Normal View History

2014-11-15 17:46:46 +00:00
class AddSecretTokenToAsciicasts < ActiveRecord::Migration
def change
add_column :asciicasts, :secret_token, :string
Asciicast.find_each do |asciicast|
asciicast.update_attribute(:secret_token, Asciicast.generate_secret_token)
2014-11-15 17:46:46 +00:00
end
change_column :asciicasts, :secret_token, :string, null: false
end
end