Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
iv
gitlab-ce
Commits
9a06dd4a
Commit
9a06dd4a
authored
Mar 04, 2013
by
Andrew8xx8
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migrations added
parent
152c6018
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
0 deletions
+28
-0
db/migrate/20130304104623_add_state_to_user.rb
db/migrate/20130304104623_add_state_to_user.rb
+5
-0
db/migrate/20130304104740_convert_blocked_to_state.rb
db/migrate/20130304104740_convert_blocked_to_state.rb
+14
-0
db/migrate/20130304105317_remove_blocked_from_user.rb
db/migrate/20130304105317_remove_blocked_from_user.rb
+9
-0
No files found.
db/migrate/20130304104623_add_state_to_user.rb
0 → 100644
View file @
9a06dd4a
class
AddStateToUser
<
ActiveRecord
::
Migration
def
change
add_column
:users
,
:state
,
:string
end
end
db/migrate/20130304104740_convert_blocked_to_state.rb
0 → 100644
View file @
9a06dd4a
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
db/migrate/20130304105317_remove_blocked_from_user.rb
0 → 100644
View file @
9a06dd4a
class
RemoveBlockedFromUser
<
ActiveRecord
::
Migration
def
up
remove_column
:users
,
:blocked
end
def
down
add_column
:users
,
:blocked
,
:boolean
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment