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
e5f048f4
Commit
e5f048f4
authored
Feb 18, 2013
by
Andrew8xx8
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migrations refactored ro support data convertion
parent
41e97a76
Changes
17
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
125 additions
and
60 deletions
+125
-60
db/migrate/20130214153504_rename_closed_to_state_in_issue.rb
db/migrate/20130214153504_rename_closed_to_state_in_issue.rb
+0
-5
db/migrate/20130214153809_change_state_type_in_issue.rb
db/migrate/20130214153809_change_state_type_in_issue.rb
+0
-9
db/migrate/20130214154847_rename_closed_to_state_in_merge_request.rb
...20130214154847_rename_closed_to_state_in_merge_request.rb
+0
-5
db/migrate/20130214155334_change_state_type_in_merge_request.rb
...rate/20130214155334_change_state_type_in_merge_request.rb
+0
-9
db/migrate/20130214155542_rename_closed_to_state_in_milestone.rb
...ate/20130214155542_rename_closed_to_state_in_milestone.rb
+0
-5
db/migrate/20130214155632_change_state_type_in_milestone.rb
db/migrate/20130214155632_change_state_type_in_milestone.rb
+0
-9
db/migrate/20130218140952_add_state_to_issue.rb
db/migrate/20130218140952_add_state_to_issue.rb
+5
-0
db/migrate/20130218141038_add_state_to_merge_request.rb
db/migrate/20130218141038_add_state_to_merge_request.rb
+5
-0
db/migrate/20130218141117_add_state_to_milestone.rb
db/migrate/20130218141117_add_state_to_milestone.rb
+5
-0
db/migrate/20130218141258_convert_closed_to_state_in_issue.rb
...igrate/20130218141258_convert_closed_to_state_in_issue.rb
+19
-0
db/migrate/20130218141327_convert_closed_to_state_in_merge_request.rb
...0130218141327_convert_closed_to_state_in_merge_request.rb
+29
-0
db/migrate/20130218141344_convert_closed_to_state_in_milestone.rb
...te/20130218141344_convert_closed_to_state_in_milestone.rb
+19
-0
db/migrate/20130218141444_remove_merged_from_merge_request.rb
...igrate/20130218141444_remove_merged_from_merge_request.rb
+0
-0
db/migrate/20130218141507_remove_closed_from_issue.rb
db/migrate/20130218141507_remove_closed_from_issue.rb
+9
-0
db/migrate/20130218141536_remove_closed_from_merge_request.rb
...igrate/20130218141536_remove_closed_from_merge_request.rb
+9
-0
db/migrate/20130218141554_remove_closed_from_milestone.rb
db/migrate/20130218141554_remove_closed_from_milestone.rb
+9
-0
db/schema.rb
db/schema.rb
+16
-18
No files found.
db/migrate/20130214153504_rename_closed_to_state_in_issue.rb
deleted
100644 → 0
View file @
41e97a76
class
RenameClosedToStateInIssue
<
ActiveRecord
::
Migration
def
change
rename_column
:issues
,
:closed
,
:state
end
end
db/migrate/20130214153809_change_state_type_in_issue.rb
deleted
100644 → 0
View file @
41e97a76
class
ChangeStateTypeInIssue
<
ActiveRecord
::
Migration
def
up
change_column
:issues
,
:state
,
:string
end
def
down
change_column
:issues
,
:state
,
:boolean
end
end
db/migrate/20130214154847_rename_closed_to_state_in_merge_request.rb
deleted
100644 → 0
View file @
41e97a76
class
RenameClosedToStateInMergeRequest
<
ActiveRecord
::
Migration
def
change
rename_column
:merge_requests
,
:closed
,
:state
end
end
db/migrate/20130214155334_change_state_type_in_merge_request.rb
deleted
100644 → 0
View file @
41e97a76
class
ChangeStateTypeInMergeRequest
<
ActiveRecord
::
Migration
def
up
change_column
:merge_requests
,
:state
,
:string
end
def
down
change_column
:merge_requests
,
:state
,
:boolean
end
end
db/migrate/20130214155542_rename_closed_to_state_in_milestone.rb
deleted
100644 → 0
View file @
41e97a76
class
RenameClosedToStateInMilestone
<
ActiveRecord
::
Migration
def
change
rename_column
:milestones
,
:closed
,
:state
end
end
db/migrate/20130214155632_change_state_type_in_milestone.rb
deleted
100644 → 0
View file @
41e97a76
class
ChangeStateTypeInMilestone
<
ActiveRecord
::
Migration
def
up
change_column
:milestones
,
:state
,
:string
end
def
down
change_column
:milestones
,
:state
,
:boolean
end
end
db/migrate/20130218140952_add_state_to_issue.rb
0 → 100644
View file @
e5f048f4
class
AddStateToIssue
<
ActiveRecord
::
Migration
def
change
add_column
:issues
,
:state
,
:string
end
end
db/migrate/20130218141038_add_state_to_merge_request.rb
0 → 100644
View file @
e5f048f4
class
AddStateToMergeRequest
<
ActiveRecord
::
Migration
def
change
add_column
:merge_requests
,
:state
,
:string
end
end
db/migrate/20130218141117_add_state_to_milestone.rb
0 → 100644
View file @
e5f048f4
class
AddStateToMilestone
<
ActiveRecord
::
Migration
def
change
add_column
:milestones
,
:state
,
:string
end
end
db/migrate/20130218141258_convert_closed_to_state_in_issue.rb
0 → 100644
View file @
e5f048f4
class
ConvertClosedToStateInIssue
<
ActiveRecord
::
Migration
def
up
Issue
.
transaction
do
Issue
.
find_each
do
|
issue
|
issue
.
state
=
issue
.
closed?
?
:closed
:
:opened
issue
.
save
end
end
end
def
down
Issue
.
transaction
do
Issue
.
find_each
do
|
issue
|
issue
.
closed
=
issue
.
closed?
issue
.
save
end
end
end
end
db/migrate/20130218141327_convert_closed_to_state_in_merge_request.rb
0 → 100644
View file @
e5f048f4
class
ConvertClosedToStateInMergeRequest
<
ActiveRecord
::
Migration
def
up
MergeRequest
.
transaction
do
MergeRequest
.
find_each
do
|
mr
|
if
mr
.
closed?
&&
mr
.
merged?
mr
.
state
=
:merged
else
if
mr
.
closed?
mr
.
state
=
:closed
else
mr
.
state
=
:opened
end
end
mr
.
save
end
end
end
def
down
MergeRequest
.
transaction
do
MergeRequest
.
find_each
do
|
mr
|
mr
.
closed
=
mr
.
closed?
||
mr
.
merged?
mr
.
closed
=
mr
.
merged?
mr
.
save
end
end
end
end
db/migrate/20130218141344_convert_closed_to_state_in_milestone.rb
0 → 100644
View file @
e5f048f4
class
ConvertClosedToStateInMilestone
<
ActiveRecord
::
Migration
def
up
Milestone
.
transaction
do
Milestone
.
find_each
do
|
milestone
|
milestone
.
state
=
milestone
.
closed?
?
:closed
:
:active
milestone
.
save
end
end
end
def
down
Milestone
.
transaction
do
Milestone
.
find_each
do
|
milestone
|
milestone
.
closed
=
milestone
.
closed?
milestone
.
save
end
end
end
end
db/migrate/20130218
0912
44_remove_merged_from_merge_request.rb
→
db/migrate/20130218
1414
44_remove_merged_from_merge_request.rb
View file @
e5f048f4
File moved
db/migrate/20130218141507_remove_closed_from_issue.rb
0 → 100644
View file @
e5f048f4
class
RemoveClosedFromIssue
<
ActiveRecord
::
Migration
def
up
remove_column
:issues
,
:closed
end
def
down
add_column
:issues
,
:closed
,
:boolean
end
end
db/migrate/20130218141536_remove_closed_from_merge_request.rb
0 → 100644
View file @
e5f048f4
class
RemoveClosedFromMergeRequest
<
ActiveRecord
::
Migration
def
up
remove_column
:merge_requests
,
:closed
end
def
down
add_column
:merge_requests
,
:closed
,
:boolean
end
end
db/migrate/20130218141554_remove_closed_from_milestone.rb
0 → 100644
View file @
e5f048f4
class
RemoveClosedFromMilestone
<
ActiveRecord
::
Migration
def
up
remove_column
:milestones
,
:closed
end
def
down
add_column
:milestones
,
:closed
,
:boolean
end
end
db/schema.rb
View file @
e5f048f4
...
...
@@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
:version
=>
20130218
09124
4
)
do
ActiveRecord
::
Schema
.
define
(
:version
=>
20130218
14155
4
)
do
create_table
"events"
,
:force
=>
true
do
|
t
|
t
.
string
"target_type"
...
...
@@ -39,11 +39,11 @@ ActiveRecord::Schema.define(:version => 20130218091244) do
t
.
integer
"project_id"
t
.
datetime
"created_at"
,
:null
=>
false
t
.
datetime
"updated_at"
,
:null
=>
false
t
.
string
"state"
,
:default
=>
"0"
,
:null
=>
false
t
.
integer
"position"
,
:default
=>
0
t
.
string
"branch_name"
t
.
text
"description"
t
.
integer
"milestone_id"
t
.
string
"state"
end
add_index
"issues"
,
[
"assignee_id"
],
:name
=>
"index_issues_on_assignee_id"
...
...
@@ -51,7 +51,6 @@ ActiveRecord::Schema.define(:version => 20130218091244) do
add_index
"issues"
,
[
"created_at"
],
:name
=>
"index_issues_on_created_at"
add_index
"issues"
,
[
"milestone_id"
],
:name
=>
"index_issues_on_milestone_id"
add_index
"issues"
,
[
"project_id"
],
:name
=>
"index_issues_on_project_id"
add_index
"issues"
,
[
"state"
],
:name
=>
"index_issues_on_closed"
add_index
"issues"
,
[
"title"
],
:name
=>
"index_issues_on_title"
create_table
"keys"
,
:force
=>
true
do
|
t
|
...
...
@@ -75,13 +74,13 @@ ActiveRecord::Schema.define(:version => 20130218091244) do
t
.
integer
"author_id"
t
.
integer
"assignee_id"
t
.
string
"title"
t
.
string
"state"
,
:default
=>
"0"
,
:null
=>
false
t
.
datetime
"created_at"
,
:null
=>
false
t
.
datetime
"updated_at"
,
:null
=>
false
t
.
text
"st_commits"
,
:limit
=>
2147483647
t
.
text
"st_diffs"
,
:limit
=>
2147483647
t
.
integer
"merge_status"
,
:default
=>
1
,
:null
=>
false
t
.
integer
"milestone_id"
t
.
string
"state"
end
add_index
"merge_requests"
,
[
"assignee_id"
],
:name
=>
"index_merge_requests_on_assignee_id"
...
...
@@ -90,7 +89,6 @@ ActiveRecord::Schema.define(:version => 20130218091244) do
add_index
"merge_requests"
,
[
"milestone_id"
],
:name
=>
"index_merge_requests_on_milestone_id"
add_index
"merge_requests"
,
[
"project_id"
],
:name
=>
"index_merge_requests_on_project_id"
add_index
"merge_requests"
,
[
"source_branch"
],
:name
=>
"index_merge_requests_on_source_branch"
add_index
"merge_requests"
,
[
"state"
],
:name
=>
"index_merge_requests_on_closed"
add_index
"merge_requests"
,
[
"target_branch"
],
:name
=>
"index_merge_requests_on_target_branch"
add_index
"merge_requests"
,
[
"title"
],
:name
=>
"index_merge_requests_on_title"
...
...
@@ -99,9 +97,9 @@ ActiveRecord::Schema.define(:version => 20130218091244) do
t
.
integer
"project_id"
,
:null
=>
false
t
.
text
"description"
t
.
date
"due_date"
t
.
string
"state"
,
:default
=>
"0"
,
:null
=>
false
t
.
datetime
"created_at"
,
:null
=>
false
t
.
datetime
"updated_at"
,
:null
=>
false
t
.
string
"state"
end
add_index
"milestones"
,
[
"due_date"
],
:name
=>
"index_milestones_on_due_date"
...
...
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