Boolean correctness in migrations
This commit is contained in:
parent
7d786c32ed
commit
061d777266
3 changed files with 3 additions and 3 deletions
|
@ -1,7 +1,7 @@
|
|||
class AddEmailValid < ActiveRecord::Migration
|
||||
def self.up
|
||||
add_column "users", "email_valid", :boolean, :default => false, :null => false
|
||||
User.update_all("email_valid = active")
|
||||
User.update_all(:email_valid => true)
|
||||
end
|
||||
|
||||
def self.down
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
class AddUserVisible < ActiveRecord::Migration
|
||||
def self.up
|
||||
add_column "users", "visible", :boolean, :default => true, :null => false
|
||||
User.update_all("visible = 1")
|
||||
User.update_all(:visible => true)
|
||||
end
|
||||
|
||||
def self.down
|
||||
|
|
|
@ -28,7 +28,7 @@ class AddChangesets < ActiveRecord::Migration
|
|||
# all the changesets will have the id of the user that made them.
|
||||
# We need to generate a changeset for each user in the database
|
||||
execute "INSERT INTO changesets (id, user_id, created_at, open)" +
|
||||
"SELECT id, id, creation_time, 0 from users;"
|
||||
"SELECT id, id, creation_time, false from users;"
|
||||
|
||||
@@conv_user_tables.each { |tbl|
|
||||
rename_column tbl, :user_id, :changeset_id
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue