diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-07-01 03:09:48 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-07-01 03:09:48 +0300 |
commit | 516b939c44ec77bb773f08df15079c80fb4d10d2 (patch) | |
tree | 7fa7670a0cd811df23d8a6b07e6473fa540ebe0f /db | |
parent | 9877050db1dd1693c672a6b29a356c5b2a7edce0 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r-- | db/docs/ci_runner_versions.yml | 9 | ||||
-rw-r--r-- | db/migrate/20220624081524_add_ci_runner_versions_table.rb | 16 | ||||
-rw-r--r-- | db/migrate/20220624090458_add_index_on_runner_version.rb | 15 | ||||
-rw-r--r-- | db/schema_migrations/20220624081524 | 1 | ||||
-rw-r--r-- | db/schema_migrations/20220624090458 | 1 | ||||
-rw-r--r-- | db/structure.sql | 15 |
6 files changed, 57 insertions, 0 deletions
diff --git a/db/docs/ci_runner_versions.yml b/db/docs/ci_runner_versions.yml new file mode 100644 index 00000000000..e0221e3956f --- /dev/null +++ b/db/docs/ci_runner_versions.yml @@ -0,0 +1,9 @@ +--- +table_name: ci_runner_versions +classes: +- Ci::RunnerVersion +feature_categories: +- runner_fleet +description: Information about used Ci::Runner versions +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/90982 +milestone: '15.2' diff --git a/db/migrate/20220624081524_add_ci_runner_versions_table.rb b/db/migrate/20220624081524_add_ci_runner_versions_table.rb new file mode 100644 index 00000000000..844c5898d75 --- /dev/null +++ b/db/migrate/20220624081524_add_ci_runner_versions_table.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class AddCiRunnerVersionsTable < Gitlab::Database::Migration[2.0] + enable_lock_retries! + + def up + create_table :ci_runner_versions, id: false do |t| + t.text :version, primary_key: true, index: true, null: false, limit: 2048 + t.integer :status, null: true, limit: 2, index: true + end + end + + def down + drop_table :ci_runner_versions, if_exists: true + end +end diff --git a/db/migrate/20220624090458_add_index_on_runner_version.rb b/db/migrate/20220624090458_add_index_on_runner_version.rb new file mode 100644 index 00000000000..e28bf0d8a76 --- /dev/null +++ b/db/migrate/20220624090458_add_index_on_runner_version.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddIndexOnRunnerVersion < Gitlab::Database::Migration[2.0] + disable_ddl_transaction! + + INDEX_NAME = 'index_ci_runners_on_version' + + def up + add_concurrent_index :ci_runners, :version, name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :ci_runners, INDEX_NAME + end +end diff --git a/db/schema_migrations/20220624081524 b/db/schema_migrations/20220624081524 new file mode 100644 index 00000000000..f643b1223a8 --- /dev/null +++ b/db/schema_migrations/20220624081524 @@ -0,0 +1 @@ +3245905956e4781629bbf6398c9534cf35eab469e8a703f755ed26de90dee0e1
\ No newline at end of file diff --git a/db/schema_migrations/20220624090458 b/db/schema_migrations/20220624090458 new file mode 100644 index 00000000000..62473bf8bd3 --- /dev/null +++ b/db/schema_migrations/20220624090458 @@ -0,0 +1 @@ +cf3c6e8d720ce48272b8b9658d3c240e8fe3c9a26284a9e169f7bb6a40c862bc
\ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index 78ba17044d4..e511bd88618 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -13080,6 +13080,12 @@ CREATE SEQUENCE ci_runner_projects_id_seq ALTER SEQUENCE ci_runner_projects_id_seq OWNED BY ci_runner_projects.id; +CREATE TABLE ci_runner_versions ( + version text NOT NULL, + status smallint, + CONSTRAINT check_b5a3714594 CHECK ((char_length(version) <= 2048)) +); + CREATE TABLE ci_runners ( id integer NOT NULL, token character varying, @@ -24577,6 +24583,9 @@ ALTER TABLE ONLY ci_runner_namespaces ALTER TABLE ONLY ci_runner_projects ADD CONSTRAINT ci_runner_projects_pkey PRIMARY KEY (id); +ALTER TABLE ONLY ci_runner_versions + ADD CONSTRAINT ci_runner_versions_pkey PRIMARY KEY (version); + ALTER TABLE ONLY ci_runners ADD CONSTRAINT ci_runners_pkey PRIMARY KEY (id); @@ -27633,6 +27642,10 @@ CREATE UNIQUE INDEX index_ci_runner_namespaces_on_runner_id_and_namespace_id ON CREATE INDEX index_ci_runner_projects_on_project_id ON ci_runner_projects USING btree (project_id); +CREATE INDEX index_ci_runner_versions_on_status ON ci_runner_versions USING btree (status); + +CREATE INDEX index_ci_runner_versions_on_version ON ci_runner_versions USING btree (version); + CREATE INDEX index_ci_runners_on_active ON ci_runners USING btree (active, id); CREATE INDEX index_ci_runners_on_contacted_at_and_id_desc ON ci_runners USING btree (contacted_at, id DESC); @@ -27663,6 +27676,8 @@ CREATE INDEX index_ci_runners_on_token_expires_at_and_id_desc ON ci_runners USIN CREATE INDEX index_ci_runners_on_token_expires_at_desc_and_id_desc ON ci_runners USING btree (token_expires_at DESC, id DESC); +CREATE INDEX index_ci_runners_on_version ON ci_runners USING btree (version); + CREATE UNIQUE INDEX index_ci_running_builds_on_build_id ON ci_running_builds USING btree (build_id); CREATE INDEX index_ci_running_builds_on_project_id ON ci_running_builds USING btree (project_id); |