Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-05-31 12:07:36 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-05-31 12:07:36 +0300
commitb7a422e845aff188077292f3833e3105dae23062 (patch)
treeb7bc96071c3c6823edf92718f4b0b3dda950dc03 /db
parent3a5eccd3d0601c058aeecc74959305e70084f2be (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r--db/database_connections/ci.yaml10
-rw-r--r--db/database_connections/main.yaml14
-rw-r--r--db/database_connections/main_clusterwide.yaml10
-rw-r--r--db/gitlab_schemas/gitlab_ci.yaml2
-rw-r--r--db/gitlab_schemas/gitlab_internal.yaml2
-rw-r--r--db/gitlab_schemas/gitlab_main.yaml2
-rw-r--r--db/gitlab_schemas/gitlab_main_clusterwide.yaml2
-rw-r--r--db/gitlab_schemas/gitlab_pm.yaml2
-rw-r--r--db/gitlab_schemas/gitlab_shared.yaml4
-rw-r--r--db/migrate/20230523122242_add_encrypted_ai_access_token.rb8
-rw-r--r--db/schema_migrations/202305231222421
-rw-r--r--db/structure.sql2
12 files changed, 59 insertions, 0 deletions
diff --git a/db/database_connections/ci.yaml b/db/database_connections/ci.yaml
new file mode 100644
index 00000000000..daa155dcb00
--- /dev/null
+++ b/db/database_connections/ci.yaml
@@ -0,0 +1,10 @@
+name: ci
+description: Cell-local GitLab database holding all CI pipelines, builds, etc.
+gitlab_schemas:
+ - gitlab_internal
+ - gitlab_shared
+ - gitlab_ci
+klass: Ci::ApplicationRecord
+# if CI database is not configured, use this database
+fallback_database: main
+uses_load_balancing: true
diff --git a/db/database_connections/main.yaml b/db/database_connections/main.yaml
new file mode 100644
index 00000000000..f6bd50a2ad8
--- /dev/null
+++ b/db/database_connections/main.yaml
@@ -0,0 +1,14 @@
+name: main
+description: Main GitLab database holding all projects, issues, etc.
+gitlab_schemas:
+ - gitlab_internal
+ - gitlab_shared
+ - gitlab_main
+ - gitlab_pm
+# Note that we use ActiveRecord::Base here and not ApplicationRecord.
+# This is deliberate, as:
+# - the load balancer must be enabled for _all_ models
+# - other models outside of Rails that are using `ActiveRecord::Base`
+# needs to use `main:`
+klass: ActiveRecord::Base
+uses_load_balancing: true
diff --git a/db/database_connections/main_clusterwide.yaml b/db/database_connections/main_clusterwide.yaml
new file mode 100644
index 00000000000..d55b2ddce40
--- /dev/null
+++ b/db/database_connections/main_clusterwide.yaml
@@ -0,0 +1,10 @@
+name: main_clusterwide
+description: Cluster-wide GitLab database holding only data shared globally across Cells.
+gitlab_schemas:
+ - gitlab_internal
+ - gitlab_shared
+ - gitlab_main_clusterwide
+klass: MainClusterwide::ApplicationRecord
+# if Cluster-wide database is not configured, fallback to using main
+fallback_database: main
+uses_load_balancing: true
diff --git a/db/gitlab_schemas/gitlab_ci.yaml b/db/gitlab_schemas/gitlab_ci.yaml
new file mode 100644
index 00000000000..ee429fbf19c
--- /dev/null
+++ b/db/gitlab_schemas/gitlab_ci.yaml
@@ -0,0 +1,2 @@
+name: gitlab_ci
+description: Schema for all Cell-local CI tables, ex. ci_builds, etc.
diff --git a/db/gitlab_schemas/gitlab_internal.yaml b/db/gitlab_schemas/gitlab_internal.yaml
new file mode 100644
index 00000000000..7093c980daa
--- /dev/null
+++ b/db/gitlab_schemas/gitlab_internal.yaml
@@ -0,0 +1,2 @@
+name: gitlab_internal
+description: Schema for all internal tables, like `pg_*`
diff --git a/db/gitlab_schemas/gitlab_main.yaml b/db/gitlab_schemas/gitlab_main.yaml
new file mode 100644
index 00000000000..ef94d9f8668
--- /dev/null
+++ b/db/gitlab_schemas/gitlab_main.yaml
@@ -0,0 +1,2 @@
+name: gitlab_main
+description: Schema for all Cell-local tables, ex. projects, issues, etc.
diff --git a/db/gitlab_schemas/gitlab_main_clusterwide.yaml b/db/gitlab_schemas/gitlab_main_clusterwide.yaml
new file mode 100644
index 00000000000..d7b54489573
--- /dev/null
+++ b/db/gitlab_schemas/gitlab_main_clusterwide.yaml
@@ -0,0 +1,2 @@
+name: gitlab_main_clusterwide
+description: Schema for all Cluster-wide tables, ex. application_settings, etc.
diff --git a/db/gitlab_schemas/gitlab_pm.yaml b/db/gitlab_schemas/gitlab_pm.yaml
new file mode 100644
index 00000000000..5cef6188c3a
--- /dev/null
+++ b/db/gitlab_schemas/gitlab_pm.yaml
@@ -0,0 +1,2 @@
+name: gitlab_pm
+description: Schema for all Cell-local package management features.
diff --git a/db/gitlab_schemas/gitlab_shared.yaml b/db/gitlab_schemas/gitlab_shared.yaml
new file mode 100644
index 00000000000..f28adf4f1cb
--- /dev/null
+++ b/db/gitlab_schemas/gitlab_shared.yaml
@@ -0,0 +1,4 @@
+name: gitlab_shared
+description:
+ Schema for all tables implementing shared features,
+ ex. loose foreign keys, re-indexing, etc.
diff --git a/db/migrate/20230523122242_add_encrypted_ai_access_token.rb b/db/migrate/20230523122242_add_encrypted_ai_access_token.rb
new file mode 100644
index 00000000000..66035dc9c02
--- /dev/null
+++ b/db/migrate/20230523122242_add_encrypted_ai_access_token.rb
@@ -0,0 +1,8 @@
+# frozen_string_literal: true
+
+class AddEncryptedAiAccessToken < Gitlab::Database::Migration[2.1]
+ def change
+ add_column :application_settings, :encrypted_ai_access_token, :binary
+ add_column :application_settings, :encrypted_ai_access_token_iv, :binary
+ end
+end
diff --git a/db/schema_migrations/20230523122242 b/db/schema_migrations/20230523122242
new file mode 100644
index 00000000000..36316e88777
--- /dev/null
+++ b/db/schema_migrations/20230523122242
@@ -0,0 +1 @@
+16c5eed18bf8beb8200fc2eaae9ffe532439e463cdb417f84eabc29992779558 \ No newline at end of file
diff --git a/db/structure.sql b/db/structure.sql
index 19d71325370..63c2d188b14 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -11844,6 +11844,8 @@ CREATE TABLE application_settings (
wiki_asciidoc_allow_uri_includes boolean DEFAULT false NOT NULL,
namespace_aggregation_schedule_lease_duration_in_seconds integer DEFAULT 300 NOT NULL,
container_registry_data_repair_detail_worker_max_concurrency integer DEFAULT 2 NOT NULL,
+ encrypted_ai_access_token bytea,
+ encrypted_ai_access_token_iv bytea,
CONSTRAINT app_settings_container_reg_cleanup_tags_max_list_size_positive CHECK ((container_registry_cleanup_tags_service_max_list_size >= 0)),
CONSTRAINT app_settings_container_registry_pre_import_tags_rate_positive CHECK ((container_registry_pre_import_tags_rate >= (0)::numeric)),
CONSTRAINT app_settings_dep_proxy_ttl_policies_worker_capacity_positive CHECK ((dependency_proxy_ttl_group_policy_worker_capacity >= 0)),