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
90d0ad42
Commit
90d0ad42
authored
Jun 01, 2021
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add shared runner builds table to the database
parent
a6460069
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
0 deletions
+54
-0
db/migrate/20210601123341_add_shared_runner_builds_table.rb
db/migrate/20210601123341_add_shared_runner_builds_table.rb
+16
-0
db/schema_migrations/20210601123341
db/schema_migrations/20210601123341
+1
-0
db/structure.sql
db/structure.sql
+37
-0
No files found.
db/migrate/20210601123341_add_shared_runner_builds_table.rb
0 → 100644
View file @
90d0ad42
# frozen_string_literal: true
class
AddSharedRunnerBuildsTable
<
ActiveRecord
::
Migration
[
6.0
]
def
up
create_table
:ci_shared_runner_builds
do
|
t
|
t
.
references
:build
,
index:
{
unique:
true
},
null:
false
,
foreign_key:
{
to_table: :ci_builds
,
on_delete: :cascade
}
t
.
references
:project
,
index:
true
,
null:
false
,
foreign_key:
{
on_delete: :cascade
}
t
.
references
:runner
,
index:
true
,
null:
false
,
foreign_key:
{
to_table: :ci_runners
,
on_delete: :cascade
}
t
.
datetime_with_timezone
:created_at
,
null:
false
,
default:
->
{
'NOW()'
}
end
end
def
down
drop_table
:ci_shared_runner_builds
end
end
db/schema_migrations/20210601123341
0 → 100644
View file @
90d0ad42
d4a0098c30cd1acea008fa5f1cfb4c23d5b5b894eab2b72f5004acc5233f2576
\ No newline at end of file
db/structure.sql
View file @
90d0ad42
...
...
@@ -11151,6 +11151,23 @@ CREATE SEQUENCE ci_runners_id_seq
ALTER SEQUENCE ci_runners_id_seq OWNED BY ci_runners.id;
CREATE TABLE ci_shared_runner_builds (
id bigint NOT NULL,
build_id bigint NOT NULL,
project_id bigint NOT NULL,
runner_id bigint NOT NULL,
created_at timestamp with time zone DEFAULT now() NOT NULL
);
CREATE SEQUENCE ci_shared_runner_builds_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER SEQUENCE ci_shared_runner_builds_id_seq OWNED BY ci_shared_runner_builds.id;
CREATE TABLE ci_sources_pipelines (
id integer NOT NULL,
project_id integer,
...
...
@@ -19697,6 +19714,8 @@ ALTER TABLE ONLY ci_runner_projects ALTER COLUMN id SET DEFAULT nextval('ci_runn
ALTER TABLE ONLY ci_runners ALTER COLUMN id SET DEFAULT nextval('ci_runners_id_seq'::regclass);
ALTER TABLE ONLY ci_shared_runner_builds ALTER COLUMN id SET DEFAULT nextval('ci_shared_runner_builds_id_seq'::regclass);
ALTER TABLE ONLY ci_sources_pipelines ALTER COLUMN id SET DEFAULT nextval('ci_sources_pipelines_id_seq'::regclass);
ALTER TABLE ONLY ci_sources_projects ALTER COLUMN id SET DEFAULT nextval('ci_sources_projects_id_seq'::regclass);
...
...
@@ -20896,6 +20915,9 @@ ALTER TABLE ONLY ci_runner_projects
ALTER TABLE ONLY ci_runners
ADD CONSTRAINT ci_runners_pkey PRIMARY KEY (id);
ALTER TABLE ONLY ci_shared_runner_builds
ADD CONSTRAINT ci_shared_runner_builds_pkey PRIMARY KEY (id);
ALTER TABLE ONLY ci_sources_pipelines
ADD CONSTRAINT ci_sources_pipelines_pkey PRIMARY KEY (id);
...
...
@@ -22882,6 +22904,12 @@ CREATE INDEX index_ci_runners_on_token ON ci_runners USING btree (token);
CREATE INDEX index_ci_runners_on_token_encrypted ON ci_runners USING btree (token_encrypted);
CREATE UNIQUE INDEX index_ci_shared_runner_builds_on_build_id ON ci_shared_runner_builds USING btree (build_id);
CREATE INDEX index_ci_shared_runner_builds_on_project_id ON ci_shared_runner_builds USING btree (project_id);
CREATE INDEX index_ci_shared_runner_builds_on_runner_id ON ci_shared_runner_builds USING btree (runner_id);
CREATE INDEX index_ci_sources_pipelines_on_pipeline_id ON ci_sources_pipelines USING btree (pipeline_id);
CREATE INDEX index_ci_sources_pipelines_on_project_id ON ci_sources_pipelines USING btree (project_id);
...
...
@@ -26394,6 +26422,9 @@ ALTER TABLE ONLY onboarding_progresses
ALTER TABLE ONLY protected_branch_unprotect_access_levels
ADD CONSTRAINT fk_rails_2d2aba21ef FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
ALTER TABLE ONLY ci_shared_runner_builds
ADD CONSTRAINT fk_rails_2de6fdddcb FOREIGN KEY (runner_id) REFERENCES ci_runners(id) ON DELETE CASCADE;
ALTER TABLE ONLY ci_freeze_periods
ADD CONSTRAINT fk_rails_2e02bbd1a6 FOREIGN KEY (project_id) REFERENCES projects(id);
...
...
@@ -26793,6 +26824,9 @@ ALTER TABLE ONLY plan_limits
ALTER TABLE ONLY operations_feature_flags_issues
ADD CONSTRAINT fk_rails_6a8856ca4f FOREIGN KEY (feature_flag_id) REFERENCES operations_feature_flags(id) ON DELETE CASCADE;
ALTER TABLE ONLY ci_shared_runner_builds
ADD CONSTRAINT fk_rails_6b0c3012c9 FOREIGN KEY (build_id) REFERENCES ci_builds(id) ON DELETE CASCADE;
ALTER TABLE ONLY prometheus_alerts
ADD CONSTRAINT fk_rails_6d9b283465 FOREIGN KEY (environment_id) REFERENCES environments(id) ON DELETE CASCADE;
...
...
@@ -26988,6 +27022,9 @@ ALTER TABLE ONLY alert_management_alert_user_mentions
ALTER TABLE ONLY project_daily_statistics
ADD CONSTRAINT fk_rails_8e549b272d FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
ALTER TABLE ONLY ci_shared_runner_builds
ADD CONSTRAINT fk_rails_8f43a1469c FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
ALTER TABLE ONLY ci_pipelines_config
ADD CONSTRAINT fk_rails_906c9a2533 FOREIGN KEY (pipeline_id) REFERENCES ci_pipelines(id) ON DELETE CASCADE;
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