diff options
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20211223125921_add_temp_index_to_members_state.rb | 16 | ||||
-rw-r--r-- | db/migrate/20220110170953_create_ci_secure_files.rb | 19 | ||||
-rw-r--r-- | db/schema_migrations/20211223125921 | 1 | ||||
-rw-r--r-- | db/schema_migrations/20220110170953 | 1 | ||||
-rw-r--r-- | db/structure.sql | 32 |
5 files changed, 69 insertions, 0 deletions
diff --git a/db/migrate/20211223125921_add_temp_index_to_members_state.rb b/db/migrate/20211223125921_add_temp_index_to_members_state.rb new file mode 100644 index 00000000000..7dd2ec1a8aa --- /dev/null +++ b/db/migrate/20211223125921_add_temp_index_to_members_state.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class AddTempIndexToMembersState < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + INDEX_NAME = 'tmp_index_members_on_state' + + def up + # Temporary index to be removed in 14.9 https://gitlab.com/gitlab-org/gitlab/-/issues/349960 + add_concurrent_index :members, :state, name: INDEX_NAME, where: 'state = 2' + end + + def down + remove_concurrent_index_by_name :members, INDEX_NAME + end +end diff --git a/db/migrate/20220110170953_create_ci_secure_files.rb b/db/migrate/20220110170953_create_ci_secure_files.rb new file mode 100644 index 00000000000..1498a2d0212 --- /dev/null +++ b/db/migrate/20220110170953_create_ci_secure_files.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class CreateCiSecureFiles < Gitlab::Database::Migration[1.0] + def up + create_table :ci_secure_files do |t| + t.bigint :project_id, index: true, null: false + t.timestamps_with_timezone null: false + t.integer :file_store, limit: 2, null: false, default: 1 + t.integer :permissions, null: false, default: 0, limit: 2 + t.text :name, null: false, limit: 255 + t.text :file, null: false, limit: 255 + t.binary :checksum, null: false + end + end + + def down + drop_table :ci_secure_files, if_exists: true + end +end diff --git a/db/schema_migrations/20211223125921 b/db/schema_migrations/20211223125921 new file mode 100644 index 00000000000..b4e3a1583df --- /dev/null +++ b/db/schema_migrations/20211223125921 @@ -0,0 +1 @@ +e08c1634376ed78b78c4a54d874bed66c1ce40c7c509b67cfda00d1a8657f127
\ No newline at end of file diff --git a/db/schema_migrations/20220110170953 b/db/schema_migrations/20220110170953 new file mode 100644 index 00000000000..d4c2aa5fcf2 --- /dev/null +++ b/db/schema_migrations/20220110170953 @@ -0,0 +1 @@ +da1c6f2db7cee1e4cb8b477d1892fa7206a95157a84864ad3d6022ab6cffbd1f
\ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index 10ae1ab0012..f9e1c638087 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -12209,6 +12209,29 @@ CREATE SEQUENCE ci_running_builds_id_seq ALTER SEQUENCE ci_running_builds_id_seq OWNED BY ci_running_builds.id; +CREATE TABLE ci_secure_files ( + id bigint NOT NULL, + project_id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + file_store smallint DEFAULT 1 NOT NULL, + permissions smallint DEFAULT 0 NOT NULL, + name text NOT NULL, + file text NOT NULL, + checksum bytea NOT NULL, + CONSTRAINT check_320790634d CHECK ((char_length(file) <= 255)), + CONSTRAINT check_402c7b4a56 CHECK ((char_length(name) <= 255)) +); + +CREATE SEQUENCE ci_secure_files_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE ci_secure_files_id_seq OWNED BY ci_secure_files.id; + CREATE TABLE ci_sources_pipelines ( id integer NOT NULL, project_id integer, @@ -21440,6 +21463,8 @@ ALTER TABLE ONLY ci_runners ALTER COLUMN id SET DEFAULT nextval('ci_runners_id_s ALTER TABLE ONLY ci_running_builds ALTER COLUMN id SET DEFAULT nextval('ci_running_builds_id_seq'::regclass); +ALTER TABLE ONLY ci_secure_files ALTER COLUMN id SET DEFAULT nextval('ci_secure_files_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); @@ -22930,6 +22955,9 @@ ALTER TABLE ONLY ci_runners ALTER TABLE ONLY ci_running_builds ADD CONSTRAINT ci_running_builds_pkey PRIMARY KEY (id); +ALTER TABLE ONLY ci_secure_files + ADD CONSTRAINT ci_secure_files_pkey PRIMARY KEY (id); + ALTER TABLE ONLY ci_sources_pipelines ADD CONSTRAINT ci_sources_pipelines_pkey PRIMARY KEY (id); @@ -25627,6 +25655,8 @@ CREATE INDEX index_ci_running_builds_on_project_id ON ci_running_builds USING bt CREATE INDEX index_ci_running_builds_on_runner_id ON ci_running_builds USING btree (runner_id); +CREATE INDEX index_ci_secure_files_on_project_id ON ci_secure_files USING btree (project_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); @@ -28035,6 +28065,8 @@ CREATE INDEX tmp_idx_deduplicate_vulnerability_occurrences ON vulnerability_occu CREATE INDEX tmp_idx_vulnerability_occurrences_on_id_where_report_type_7_99 ON vulnerability_occurrences USING btree (id) WHERE (report_type = ANY (ARRAY[7, 99])); +CREATE INDEX tmp_index_members_on_state ON members USING btree (state) WHERE (state = 2); + CREATE INDEX tmp_index_namespaces_empty_traversal_ids_with_child_namespaces ON namespaces USING btree (id) WHERE ((parent_id IS NOT NULL) AND (traversal_ids = '{}'::integer[])); CREATE INDEX tmp_index_namespaces_empty_traversal_ids_with_root_namespaces ON namespaces USING btree (id) WHERE ((parent_id IS NULL) AND (traversal_ids = '{}'::integer[])); |