diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-13 00:13:31 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-13 00:13:31 +0300 |
commit | 42a4fe5b394e010b3f512a5a138359618295193b (patch) | |
tree | 9552d72a17537c74f813d489e822e09e91d1dc3c /db | |
parent | 6121ad5af38294f12db08f13aec122c3dbef583a (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r-- | db/docs/batched_background_migrations/backfill_project_wiki_repositories.yml | 4 | ||||
-rw-r--r-- | db/docs/views/postgres_sequences.yml | 10 | ||||
-rw-r--r-- | db/migrate/20231205163658_add_code_suggestions_to_project_setting.rb | 10 | ||||
-rw-r--r-- | db/migrate/20231207144215_add_postgres_sequences_view.rb | 28 | ||||
-rw-r--r-- | db/post_migrate/20231207221013_finalize_backfill_project_wiki_repositories.rb | 21 | ||||
-rw-r--r-- | db/schema_migrations/20231205163658 | 1 | ||||
-rw-r--r-- | db/schema_migrations/20231207144215 | 1 | ||||
-rw-r--r-- | db/schema_migrations/20231207221013 | 1 | ||||
-rw-r--r-- | db/structure.sql | 11 |
9 files changed, 85 insertions, 2 deletions
diff --git a/db/docs/batched_background_migrations/backfill_project_wiki_repositories.yml b/db/docs/batched_background_migrations/backfill_project_wiki_repositories.yml index 3aaeee19c73..4d55cad0f5a 100644 --- a/db/docs/batched_background_migrations/backfill_project_wiki_repositories.yml +++ b/db/docs/batched_background_migrations/backfill_project_wiki_repositories.yml @@ -1,8 +1,8 @@ --- migration_job_name: BackfillProjectWikiRepositories -description: >- - Backfills the project_wiki_repositories table for each project that still +description: Backfills the project_wiki_repositories table for each project that still does not have an entry in this table. feature_category: geo introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/113783 milestone: '15.10' +finalized_by: '20231207221013' diff --git a/db/docs/views/postgres_sequences.yml b/db/docs/views/postgres_sequences.yml new file mode 100644 index 00000000000..7937a5511bf --- /dev/null +++ b/db/docs/views/postgres_sequences.yml @@ -0,0 +1,10 @@ +--- +view_name: postgres_sequences +classes: + - Gitlab::Database::PostgresSequence +feature_categories: + - database +description: SQL view to get information about postgres sequences +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/139117 +milestone: '16.7' +gitlab_schema: gitlab_shared diff --git a/db/migrate/20231205163658_add_code_suggestions_to_project_setting.rb b/db/migrate/20231205163658_add_code_suggestions_to_project_setting.rb new file mode 100644 index 00000000000..53c303963a5 --- /dev/null +++ b/db/migrate/20231205163658_add_code_suggestions_to_project_setting.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +class AddCodeSuggestionsToProjectSetting < Gitlab::Database::Migration[2.2] + enable_lock_retries! + milestone '16.7' + + def change + add_column :project_settings, :code_suggestions, :boolean, default: true, null: false + end +end diff --git a/db/migrate/20231207144215_add_postgres_sequences_view.rb b/db/migrate/20231207144215_add_postgres_sequences_view.rb new file mode 100644 index 00000000000..6187bb5f15e --- /dev/null +++ b/db/migrate/20231207144215_add_postgres_sequences_view.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +class AddPostgresSequencesView < Gitlab::Database::Migration[2.2] + milestone '16.7' + enable_lock_retries! + + def up + execute(<<~SQL) + CREATE OR REPLACE VIEW postgres_sequences + AS + SELECT seq_pg_class.relname AS seq_name, + dep_pg_class.relname AS table_name, + pg_attribute.attname AS col_name + FROM pg_class seq_pg_class + INNER JOIN pg_depend ON seq_pg_class.oid = pg_depend.objid + INNER JOIN pg_class dep_pg_class ON pg_depend.refobjid = dep_pg_class.oid + INNER JOIN pg_attribute ON dep_pg_class.oid = pg_attribute.attrelid + AND pg_depend.refobjsubid = pg_attribute.attnum + WHERE seq_pg_class.relkind = 'S' + SQL + end + + def down + execute(<<~SQL) + DROP VIEW postgres_sequences; + SQL + end +end diff --git a/db/post_migrate/20231207221013_finalize_backfill_project_wiki_repositories.rb b/db/post_migrate/20231207221013_finalize_backfill_project_wiki_repositories.rb new file mode 100644 index 00000000000..b26ff3645e3 --- /dev/null +++ b/db/post_migrate/20231207221013_finalize_backfill_project_wiki_repositories.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +class FinalizeBackfillProjectWikiRepositories < Gitlab::Database::Migration[2.2] + milestone '16.7' + + disable_ddl_transaction! + + restrict_gitlab_migration gitlab_schema: :gitlab_main + + def up + ensure_batched_background_migration_is_finished( + job_class_name: 'BackfillProjectWikiRepositories', + table_name: :projects, + column_name: :id, + job_arguments: [], + finalize: true + ) + end + + def down; end +end diff --git a/db/schema_migrations/20231205163658 b/db/schema_migrations/20231205163658 new file mode 100644 index 00000000000..c2ecfa8486b --- /dev/null +++ b/db/schema_migrations/20231205163658 @@ -0,0 +1 @@ +94118057fe8e0d4ed9ac6590e3aa48088f26524f02dead72f338ff58c078ef33
\ No newline at end of file diff --git a/db/schema_migrations/20231207144215 b/db/schema_migrations/20231207144215 new file mode 100644 index 00000000000..971d4918577 --- /dev/null +++ b/db/schema_migrations/20231207144215 @@ -0,0 +1 @@ +871cc15f04f235ff2719eb334c28041a0f1093653e5ca2fad5e92b911622d221
\ No newline at end of file diff --git a/db/schema_migrations/20231207221013 b/db/schema_migrations/20231207221013 new file mode 100644 index 00000000000..fad9a767d63 --- /dev/null +++ b/db/schema_migrations/20231207221013 @@ -0,0 +1 @@ +a070e5c7b51853b44fc3402de428cff14c0ad2728dd2f24fef542e86a51da2d3
\ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index 3e55c8ff615..b855817e6a9 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -21617,6 +21617,16 @@ CREATE SEQUENCE postgres_reindex_queued_actions_id_seq ALTER SEQUENCE postgres_reindex_queued_actions_id_seq OWNED BY postgres_reindex_queued_actions.id; +CREATE VIEW postgres_sequences AS + SELECT seq_pg_class.relname AS seq_name, + dep_pg_class.relname AS table_name, + pg_attribute.attname AS col_name + FROM (((pg_class seq_pg_class + JOIN pg_depend ON ((seq_pg_class.oid = pg_depend.objid))) + JOIN pg_class dep_pg_class ON ((pg_depend.refobjid = dep_pg_class.oid))) + JOIN pg_attribute ON (((dep_pg_class.oid = pg_attribute.attrelid) AND (pg_depend.refobjsubid = pg_attribute.attnum)))) + WHERE (seq_pg_class.relkind = 'S'::"char"); + CREATE TABLE programming_languages ( id integer NOT NULL, name character varying NOT NULL, @@ -22200,6 +22210,7 @@ CREATE TABLE project_settings ( encrypted_product_analytics_configurator_connection_string_iv bytea, pages_multiple_versions_enabled boolean DEFAULT false NOT NULL, allow_merge_without_pipeline boolean DEFAULT false NOT NULL, + code_suggestions boolean DEFAULT true NOT NULL, CONSTRAINT check_1a30456322 CHECK ((char_length(pages_unique_domain) <= 63)), CONSTRAINT check_3a03e7557a CHECK ((char_length(previous_default_branch) <= 4096)), CONSTRAINT check_3ca5cbffe6 CHECK ((char_length(issue_branch_template) <= 255)), |