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
Léo-Paul Géneau
gitlab-ce
Commits
f97ec4b8
Commit
f97ec4b8
authored
Sep 24, 2018
by
Shinya Maeda
Committed by
Alessio Caiazza
Oct 02, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add scheduled_at column to ci_builds, and add a partial index as well
parent
571a934f
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
20 deletions
+31
-20
db/migrate/20180913102839_create_build_schedules.rb
db/migrate/20180913102839_create_build_schedules.rb
+0
-19
db/migrate/20180924190739_add_scheduled_at_to_ci_builds.rb
db/migrate/20180924190739_add_scheduled_at_to_ci_builds.rb
+9
-0
db/migrate/20180924201039_add_partial_index_to_scheduled_at.rb
...grate/20180924201039_add_partial_index_to_scheduled_at.rb
+18
-0
db/schema.rb
db/schema.rb
+4
-1
No files found.
db/migrate/20180913102839_create_build_schedules.rb
deleted
100644 → 0
View file @
571a934f
# frozen_string_literal: true
class
CreateBuildSchedules
<
ActiveRecord
::
Migration
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
disable_ddl_transaction!
def
change
create_table
:ci_build_schedules
,
id: :bigserial
do
|
t
|
t
.
integer
:build_id
,
null:
false
t
.
datetime
:execute_at
,
null:
false
t
.
foreign_key
:ci_builds
,
column: :build_id
,
on_delete: :cascade
t
.
index
:build_id
,
unique:
true
end
end
end
db/migrate/20180924190739_add_scheduled_at_to_ci_builds.rb
0 → 100644
View file @
f97ec4b8
# frozen_string_literal: true
class
AddScheduledAtToCiBuilds
<
ActiveRecord
::
Migration
DOWNTIME
=
false
def
change
add_column
:ci_builds
,
:scheduled_at
,
:datetime_with_timezone
end
end
db/migrate/20180924201039_add_partial_index_to_scheduled_at.rb
0 → 100644
View file @
f97ec4b8
# frozen_string_literal: true
class
AddPartialIndexToScheduledAt
<
ActiveRecord
::
Migration
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
INDEX_NAME
=
'partial_index_ci_builds_on_id_with_scheduled_jobs'
.
freeze
disable_ddl_transaction!
def
up
add_concurrent_index
(
:ci_builds
,
:id
,
where:
"scheduled_at <> NULL"
,
name:
INDEX_NAME
)
end
def
down
remove_concurrent_index_by_name
(
:ci_builds
,
INDEX_NAME
)
end
end
db/schema.rb
View file @
f97ec4b8
...
...
@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
version:
20180924
14194
9
)
do
ActiveRecord
::
Schema
.
define
(
version:
20180924
20103
9
)
do
# These are extensions that must be enabled in order to support this database
enable_extension
"plpgsql"
...
...
@@ -341,6 +341,7 @@ ActiveRecord::Schema.define(version: 20180924141949) do
t
.
integer
"artifacts_metadata_store"
t
.
boolean
"protected"
t
.
integer
"failure_reason"
t
.
datetime_with_timezone
"scheduled_at"
end
add_index
"ci_builds"
,
[
"artifacts_expire_at"
],
name:
"index_ci_builds_on_artifacts_expire_at"
,
where:
"(artifacts_file <> ''::text)"
,
using: :btree
...
...
@@ -350,6 +351,7 @@ ActiveRecord::Schema.define(version: 20180924141949) do
add_index
"ci_builds"
,
[
"commit_id"
,
"type"
,
"name"
,
"ref"
],
name:
"index_ci_builds_on_commit_id_and_type_and_name_and_ref"
,
using: :btree
add_index
"ci_builds"
,
[
"commit_id"
,
"type"
,
"ref"
],
name:
"index_ci_builds_on_commit_id_and_type_and_ref"
,
using: :btree
add_index
"ci_builds"
,
[
"id"
],
name:
"partial_index_ci_builds_on_id_with_legacy_artifacts"
,
where:
"(artifacts_file <> ''::text)"
,
using: :btree
add_index
"ci_builds"
,
[
"id"
],
name:
"partial_index_ci_builds_on_id_with_scheduled_jobs"
,
where:
"(scheduled_at <> NULL::timestamp with time zone)"
,
using: :btree
add_index
"ci_builds"
,
[
"project_id"
,
"id"
],
name:
"index_ci_builds_on_project_id_and_id"
,
using: :btree
add_index
"ci_builds"
,
[
"protected"
],
name:
"index_ci_builds_on_protected"
,
using: :btree
add_index
"ci_builds"
,
[
"runner_id"
],
name:
"index_ci_builds_on_runner_id"
,
using: :btree
...
...
@@ -1799,6 +1801,7 @@ ActiveRecord::Schema.define(version: 20180924141949) do
end
add_index
"redirect_routes"
,
[
"path"
],
name:
"index_redirect_routes_on_path"
,
unique:
true
,
using: :btree
add_index
"redirect_routes"
,
[
"path"
],
name:
"index_redirect_routes_on_path_text_pattern_ops"
,
using: :btree
,
opclasses:
{
"path"
=>
"varchar_pattern_ops"
}
add_index
"redirect_routes"
,
[
"source_type"
,
"source_id"
],
name:
"index_redirect_routes_on_source_type_and_source_id"
,
using: :btree
create_table
"releases"
,
force: :cascade
do
|
t
|
...
...
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