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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
de724a7a
Commit
de724a7a
authored
Jan 22, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve db schema for merge request diffs
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
c983e8eb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
10 deletions
+21
-10
db/migrate/20140122112253_create_merge_request_diffs.rb
db/migrate/20140122112253_create_merge_request_diffs.rb
+1
-1
db/migrate/20140122122549_remove_m_rdiff_fields.rb
db/migrate/20140122122549_remove_m_rdiff_fields.rb
+13
-0
db/schema.rb
db/schema.rb
+7
-9
No files found.
db/migrate/20140122112253_create_merge_request_diffs.rb
View file @
de724a7a
class
CreateMergeRequestDiffs
<
ActiveRecord
::
Migration
def
change
create_table
:merge_request_diffs
do
|
t
|
t
.
string
:state
,
null:
false
,
default:
'
vali
d'
t
.
string
:state
,
null:
false
,
default:
'
collecte
d'
t
.
text
:st_commits
,
null:
true
,
limit:
2147483647
t
.
text
:st_diffs
,
null:
true
,
limit:
2147483647
t
.
integer
:merge_request_id
,
null:
false
...
...
db/migrate/20140122122549_remove_m_rdiff_fields.rb
0 → 100644
View file @
de724a7a
class
RemoveMRdiffFields
<
ActiveRecord
::
Migration
def
up
remove_column
:merge_requests
,
:st_commits
remove_column
:merge_requests
,
:st_diffs
end
def
down
add_column
:merge_requests
,
:st_commits
,
:text
,
null:
true
,
limit:
2147483647
add_column
:merge_requests
,
:st_diffs
,
:text
,
null:
true
,
limit:
2147483647
execute
"UPDATE merge_requests mr, merge_request_diffs md SET mr.st_commits = md.st_commits WHERE md.merge_request_id = mr.id"
execute
"UPDATE merge_requests mr, merge_request_diffs md SET mr.st_diffs = md.st_diffs WHERE md.merge_request_id = mr.id"
end
end
db/schema.rb
View file @
de724a7a
...
...
@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
version:
201401221
14406
)
do
ActiveRecord
::
Schema
.
define
(
version:
201401221
22549
)
do
create_table
"broadcast_messages"
,
force:
true
do
|
t
|
t
.
text
"message"
,
null:
false
...
...
@@ -96,29 +96,27 @@ ActiveRecord::Schema.define(version: 20140122114406) do
add_index
"keys"
,
[
"user_id"
],
name:
"index_keys_on_user_id"
,
using: :btree
create_table
"merge_request_diffs"
,
force:
true
do
|
t
|
t
.
string
"state"
,
default:
"
vali
d"
,
null:
false
t
.
string
"state"
,
default:
"
collecte
d"
,
null:
false
t
.
text
"st_commits"
,
limit:
2147483647
t
.
text
"st_diffs"
,
limit:
2147483647
t
.
integer
"merge_request_id"
,
null:
false
t
.
integer
"merge_request_id"
,
null:
false
t
.
datetime
"created_at"
t
.
datetime
"updated_at"
end
create_table
"merge_requests"
,
force:
true
do
|
t
|
t
.
string
"target_branch"
,
null:
false
t
.
string
"source_branch"
,
null:
false
t
.
integer
"source_project_id"
,
null:
false
t
.
string
"target_branch"
,
null:
false
t
.
string
"source_branch"
,
null:
false
t
.
integer
"source_project_id"
,
null:
false
t
.
integer
"author_id"
t
.
integer
"assignee_id"
t
.
string
"title"
t
.
datetime
"created_at"
t
.
datetime
"updated_at"
t
.
text
"st_commits"
,
limit:
2147483647
t
.
text
"st_diffs"
,
limit:
2147483647
t
.
integer
"milestone_id"
t
.
string
"state"
t
.
string
"merge_status"
t
.
integer
"target_project_id"
,
null:
false
t
.
integer
"target_project_id"
,
null:
false
t
.
integer
"iid"
t
.
text
"description"
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