mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-09 12:46:07 +10:00
Migrations added
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
class AddStateToUser < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :users, :state, :string
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,14 @@
|
||||
class ConvertBlockedToState < ActiveRecord::Migration
|
||||
def up
|
||||
User.transaction do
|
||||
User.where(blocked: true).update_all(state: :blocked)
|
||||
User.where(blocked: false).update_all(state: :active)
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
User.transaction do
|
||||
User.where(satate: :blocked).update_all(blocked: :true)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,9 @@
|
||||
class RemoveBlockedFromUser < ActiveRecord::Migration
|
||||
def up
|
||||
remove_column :users, :blocked
|
||||
end
|
||||
|
||||
def down
|
||||
add_column :users, :blocked, :boolean
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user