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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
3dff8b82
Commit
3dff8b82
authored
Jan 29, 2016
by
Valery Sizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ES: update schema
parent
eabad632
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
app/models/index_status.rb
app/models/index_status.rb
+1
-1
db/schema.rb
db/schema.rb
+2
-2
lib/tasks/gitlab/elastic.rake
lib/tasks/gitlab/elastic.rake
+3
-3
No files found.
app/models/index_status.rb
View file @
3dff8b82
class
IndexStatus
<
ActiveRecord
::
Base
class
IndexStatus
<
ActiveRecord
::
Base
belongs_to
:project
belongs_to
:project
validates
:project_id
,
uniqueness:
true
,
presen
s
e:
true
validates
:project_id
,
uniqueness:
true
,
presen
c
e:
true
end
end
db/schema.rb
View file @
3dff8b82
...
@@ -449,7 +449,7 @@ ActiveRecord::Schema.define(version: 20160129075828) do
...
@@ -449,7 +449,7 @@ ActiveRecord::Schema.define(version: 20160129075828) do
add_index
"identities"
,
[
"user_id"
],
name:
"index_identities_on_user_id"
,
using: :btree
add_index
"identities"
,
[
"user_id"
],
name:
"index_identities_on_user_id"
,
using: :btree
create_table
"index_statuses"
,
force: :cascade
do
|
t
|
create_table
"index_statuses"
,
force: :cascade
do
|
t
|
t
.
integer
"project_id"
t
.
integer
"project_id"
,
null:
false
t
.
datetime
"indexed_at"
t
.
datetime
"indexed_at"
t
.
text
"note"
t
.
text
"note"
t
.
string
"last_commit"
t
.
string
"last_commit"
...
@@ -457,7 +457,7 @@ ActiveRecord::Schema.define(version: 20160129075828) do
...
@@ -457,7 +457,7 @@ ActiveRecord::Schema.define(version: 20160129075828) do
t
.
datetime
"updated_at"
,
null:
false
t
.
datetime
"updated_at"
,
null:
false
end
end
add_index
"index_statuses"
,
[
"project_id"
],
name:
"index_index_statuses_on_project_id"
,
using: :btree
add_index
"index_statuses"
,
[
"project_id"
],
name:
"index_index_statuses_on_project_id"
,
u
nique:
true
,
u
sing: :btree
create_table
"issues"
,
force: :cascade
do
|
t
|
create_table
"issues"
,
force: :cascade
do
|
t
|
t
.
string
"title"
t
.
string
"title"
...
...
lib/tasks/gitlab/elastic.rake
View file @
3dff8b82
...
@@ -11,9 +11,9 @@ namespace :gitlab do
...
@@ -11,9 +11,9 @@ namespace :gitlab do
puts
"Indexing
#{
project
.
name_with_namespace
}
(ID=
#{
project
.
id
}
)..."
puts
"Indexing
#{
project
.
name_with_namespace
}
(ID=
#{
project
.
id
}
)..."
index_status
=
IndexStatus
.
find_or_create_by
(
project:
project
)
index_status
=
IndexStatus
.
find_or_create_by
(
project:
project
)
head
s
_sha
=
project
.
repository
.
commit
.
sha
head_sha
=
project
.
repository
.
commit
.
sha
if
index_status
.
last_commit
==
head
s
_sha
if
index_status
.
last_commit
==
head_sha
puts
"Skipped"
.
yellow
puts
"Skipped"
.
yellow
next
next
end
end
...
@@ -24,7 +24,7 @@ namespace :gitlab do
...
@@ -24,7 +24,7 @@ namespace :gitlab do
# During indexing the new commits can be pushed,
# During indexing the new commits can be pushed,
# the last_commit parameter only indicates that at least this commit is in index
# the last_commit parameter only indicates that at least this commit is in index
index_status
.
update
(
last_commit:
head
s
_sha
,
indexed_at:
DateTime
.
now
)
index_status
.
update
(
last_commit:
head_sha
,
indexed_at:
DateTime
.
now
)
puts
"Done!"
.
green
puts
"Done!"
.
green
rescue
StandardError
=>
e
rescue
StandardError
=>
e
puts
"
#{
e
.
message
}
, trace -
#{
e
.
backtrace
}
"
puts
"
#{
e
.
message
}
, trace -
#{
e
.
backtrace
}
"
...
...
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