diff options
| author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-08 03:12:29 +0000 |
|---|---|---|
| committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-08 03:12:29 +0000 |
| commit | 746488c848df9868601d0db51a5d3da65e29e3b6 (patch) | |
| tree | d7b55070ad21091c2663623e59566df2692c7047 /db | |
| parent | ca23d770bd782ceca306e4a95054dc62bd32ecfd (diff) | |
| download | gitlab-ce-746488c848df9868601d0db51a5d3da65e29e3b6.tar.gz | |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
| -rw-r--r-- | db/docs/deleted_tables/clusters_applications_cilium.yml (renamed from db/docs/clusters_applications_cilium.yml) | 2 | ||||
| -rw-r--r-- | db/docs/deleted_tables/clusters_applications_ingress.yml (renamed from db/docs/clusters_applications_ingress.yml) | 2 | ||||
| -rw-r--r-- | db/docs/deleted_tables/clusters_applications_prometheus.yml (renamed from db/docs/clusters_applications_prometheus.yml) | 2 | ||||
| -rw-r--r-- | db/post_migrate/20230502134532_drop_clusters_applications_cilium.rb | 23 | ||||
| -rw-r--r-- | db/post_migrate/20230502201251_drop_clusters_applications_ingress.rb | 32 | ||||
| -rw-r--r-- | db/post_migrate/20230503173101_drop_clusters_applications_prometheus.rb | 30 | ||||
| -rw-r--r-- | db/schema_migrations/20230502134532 | 1 | ||||
| -rw-r--r-- | db/schema_migrations/20230502201251 | 1 | ||||
| -rw-r--r-- | db/schema_migrations/20230503173101 | 1 | ||||
| -rw-r--r-- | db/structure.sql | 85 |
10 files changed, 94 insertions, 85 deletions
diff --git a/db/docs/clusters_applications_cilium.yml b/db/docs/deleted_tables/clusters_applications_cilium.yml index 12e5753f12e..0dd4be4f94f 100644 --- a/db/docs/clusters_applications_cilium.yml +++ b/db/docs/deleted_tables/clusters_applications_cilium.yml @@ -6,3 +6,5 @@ description: Information about installed instance of Cilium in the cluster introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/34601 milestone: '13.2' gitlab_schema: gitlab_main +removed_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/119332 +removed_in_milestone: '16.0' diff --git a/db/docs/clusters_applications_ingress.yml b/db/docs/deleted_tables/clusters_applications_ingress.yml index b03d63f1cc6..d06486f37a4 100644 --- a/db/docs/clusters_applications_ingress.yml +++ b/db/docs/deleted_tables/clusters_applications_ingress.yml @@ -6,3 +6,5 @@ description: "(Deprecated) A GitLab managed Ingress installation in a Kubernetes introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/d8223468ae2ae061020cc26336c51dc93cc75571 milestone: '10.2' gitlab_schema: gitlab_main +removed_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/119386 +removed_in_milestone: '16.0' diff --git a/db/docs/clusters_applications_prometheus.yml b/db/docs/deleted_tables/clusters_applications_prometheus.yml index f80b676ae4a..eb33a41e181 100644 --- a/db/docs/clusters_applications_prometheus.yml +++ b/db/docs/deleted_tables/clusters_applications_prometheus.yml @@ -6,3 +6,5 @@ description: Information about installed instance of Prometheus in the cluster introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/0d4548026f3060ca0a8f7aa8d8fc89838bc66130 milestone: '10.4' gitlab_schema: gitlab_main +removed_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/119533 +removed_in_milestone: '16.0' diff --git a/db/post_migrate/20230502134532_drop_clusters_applications_cilium.rb b/db/post_migrate/20230502134532_drop_clusters_applications_cilium.rb new file mode 100644 index 00000000000..8d80bae0a52 --- /dev/null +++ b/db/post_migrate/20230502134532_drop_clusters_applications_cilium.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +# See https://docs.gitlab.com/ee/development/migration_style_guide.html +# for more information on how to write migrations for GitLab. + +class DropClustersApplicationsCilium < Gitlab::Database::Migration[2.1] + def up + drop_table :clusters_applications_cilium + end + + # Based on original migration: + # https://gitlab.com/gitlab-org/gitlab/-/blob/b237f836df215a4ada92b9406733e6cd2483ca2d/db/migrate/20200615234047_create_clusters_applications_cilium.rb + # rubocop:disable Migration/SchemaAdditionMethodsNoPost + def down + create_table :clusters_applications_cilium do |t| + t.references :cluster, null: false, index: { unique: true } + t.timestamps_with_timezone null: false + t.integer :status, null: false + t.text :status_reason # rubocop:disable Migration/AddLimitToTextColumns + end + end + # rubocop:enable Migration/SchemaAdditionMethodsNoPost +end diff --git a/db/post_migrate/20230502201251_drop_clusters_applications_ingress.rb b/db/post_migrate/20230502201251_drop_clusters_applications_ingress.rb new file mode 100644 index 00000000000..a349346f91b --- /dev/null +++ b/db/post_migrate/20230502201251_drop_clusters_applications_ingress.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +# See https://docs.gitlab.com/ee/development/migration_style_guide.html +# for more information on how to write migrations for GitLab. + +class DropClustersApplicationsIngress < Gitlab::Database::Migration[2.1] + def up + drop_table :clusters_applications_ingress + end + + # Based on init schema: + # https://gitlab.com/gitlab-org/gitlab/-/blob/b237f836df215a4ada92b9406733e6cd2483ca2d/db/migrate/20181228175414_init_schema.rb#L704-L715 + # rubocop:disable Migration/SchemaAdditionMethodsNoPost + # rubocop:disable Migration/Datetime + def down + create_table "clusters_applications_ingress", id: :serial, force: :cascade do |t| + t.integer "cluster_id", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.integer "status", null: false + t.integer "ingress_type", null: false + t.string "version", null: false + t.string "cluster_ip" + t.text "status_reason" + t.string "external_ip" + t.string "external_hostname" + t.index ["cluster_id"], name: "index_clusters_applications_ingress_on_cluster_id", unique: true + end + end + # rubocop:enable Migration/SchemaAdditionMethodsNoPost + # rubocop:enable Migration/Datetime +end diff --git a/db/post_migrate/20230503173101_drop_clusters_applications_prometheus.rb b/db/post_migrate/20230503173101_drop_clusters_applications_prometheus.rb new file mode 100644 index 00000000000..6391c1ee5ae --- /dev/null +++ b/db/post_migrate/20230503173101_drop_clusters_applications_prometheus.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# See https://docs.gitlab.com/ee/development/migration_style_guide.html +# for more information on how to write migrations for GitLab. + +class DropClustersApplicationsPrometheus < Gitlab::Database::Migration[2.1] + def up + drop_table :clusters_applications_prometheus + end + + # Based on init schema: + # https://gitlab.com/gitlab-org/gitlab/-/blob/b237f836df215a4ada92b9406733e6cd2483ca2d/db/migrate/20181228175414_init_schema.rb#L742-L750 + # rubocop:disable Migration/SchemaAdditionMethodsNoPost + def down + create_table "clusters_applications_prometheus", id: :serial, force: :cascade do |t| + t.integer "cluster_id", null: false + t.integer "status", null: false + t.string "version", null: false + t.text "status_reason" + t.datetime_with_timezone "created_at", null: false + t.datetime_with_timezone "updated_at", null: false + t.index ["cluster_id"], name: "index_clusters_applications_prometheus_on_cluster_id", unique: true + t.datetime_with_timezone "last_update_started_at" + t.string "encrypted_alert_manager_token" + t.string "encrypted_alert_manager_token_iv" + t.boolean "healthy" + end + end + # rubocop:enable Migration/SchemaAdditionMethodsNoPost +end diff --git a/db/schema_migrations/20230502134532 b/db/schema_migrations/20230502134532 new file mode 100644 index 00000000000..3fddcce3f7f --- /dev/null +++ b/db/schema_migrations/20230502134532 @@ -0,0 +1 @@ +6ba72f7fa8d90e6cf5f880b950c52e3643eb6d72672e66df71d0879957704a07
\ No newline at end of file diff --git a/db/schema_migrations/20230502201251 b/db/schema_migrations/20230502201251 new file mode 100644 index 00000000000..7acaa004549 --- /dev/null +++ b/db/schema_migrations/20230502201251 @@ -0,0 +1 @@ +55c34b57a1cfdc706c7e8ab53cb964011b81fce313404d0da91a9d0495ee1fd8
\ No newline at end of file diff --git a/db/schema_migrations/20230503173101 b/db/schema_migrations/20230503173101 new file mode 100644 index 00000000000..9f327e25050 --- /dev/null +++ b/db/schema_migrations/20230503173101 @@ -0,0 +1 @@ +d30a71027d3b43e5545772d42bd68b9f7b8699787aaab7f35cd1a58603288cda
\ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index 2fd0a3e40b3..a84efd98fb4 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -14335,24 +14335,6 @@ CREATE TABLE clusters ( helm_major_version integer DEFAULT 3 NOT NULL ); -CREATE TABLE clusters_applications_cilium ( - id bigint NOT NULL, - cluster_id bigint NOT NULL, - created_at timestamp with time zone NOT NULL, - updated_at timestamp with time zone NOT NULL, - status integer NOT NULL, - status_reason text -); - -CREATE SEQUENCE clusters_applications_cilium_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - -ALTER SEQUENCE clusters_applications_cilium_id_seq OWNED BY clusters_applications_cilium.id; - CREATE TABLE clusters_applications_helm ( id integer NOT NULL, cluster_id integer NOT NULL, @@ -14375,29 +14357,6 @@ CREATE SEQUENCE clusters_applications_helm_id_seq ALTER SEQUENCE clusters_applications_helm_id_seq OWNED BY clusters_applications_helm.id; -CREATE TABLE clusters_applications_ingress ( - id integer NOT NULL, - cluster_id integer NOT NULL, - created_at timestamp without time zone NOT NULL, - updated_at timestamp without time zone NOT NULL, - status integer NOT NULL, - ingress_type integer NOT NULL, - version character varying NOT NULL, - cluster_ip character varying, - status_reason text, - external_ip character varying, - external_hostname character varying -); - -CREATE SEQUENCE clusters_applications_ingress_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - -ALTER SEQUENCE clusters_applications_ingress_id_seq OWNED BY clusters_applications_ingress.id; - CREATE TABLE clusters_applications_knative ( id integer NOT NULL, cluster_id integer NOT NULL, @@ -14420,29 +14379,6 @@ CREATE SEQUENCE clusters_applications_knative_id_seq ALTER SEQUENCE clusters_applications_knative_id_seq OWNED BY clusters_applications_knative.id; -CREATE TABLE clusters_applications_prometheus ( - id integer NOT NULL, - cluster_id integer NOT NULL, - status integer NOT NULL, - version character varying NOT NULL, - status_reason text, - created_at timestamp with time zone NOT NULL, - updated_at timestamp with time zone NOT NULL, - last_update_started_at timestamp with time zone, - encrypted_alert_manager_token character varying, - encrypted_alert_manager_token_iv character varying, - healthy boolean -); - -CREATE SEQUENCE clusters_applications_prometheus_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - -ALTER SEQUENCE clusters_applications_prometheus_id_seq OWNED BY clusters_applications_prometheus.id; - CREATE TABLE clusters_applications_runners ( id integer NOT NULL, cluster_id integer NOT NULL, @@ -25010,16 +24946,10 @@ ALTER TABLE ONLY cluster_providers_gcp ALTER COLUMN id SET DEFAULT nextval('clus ALTER TABLE ONLY clusters ALTER COLUMN id SET DEFAULT nextval('clusters_id_seq'::regclass); -ALTER TABLE ONLY clusters_applications_cilium ALTER COLUMN id SET DEFAULT nextval('clusters_applications_cilium_id_seq'::regclass); - ALTER TABLE ONLY clusters_applications_helm ALTER COLUMN id SET DEFAULT nextval('clusters_applications_helm_id_seq'::regclass); -ALTER TABLE ONLY clusters_applications_ingress ALTER COLUMN id SET DEFAULT nextval('clusters_applications_ingress_id_seq'::regclass); - ALTER TABLE ONLY clusters_applications_knative ALTER COLUMN id SET DEFAULT nextval('clusters_applications_knative_id_seq'::regclass); -ALTER TABLE ONLY clusters_applications_prometheus ALTER COLUMN id SET DEFAULT nextval('clusters_applications_prometheus_id_seq'::regclass); - ALTER TABLE ONLY clusters_applications_runners ALTER COLUMN id SET DEFAULT nextval('clusters_applications_runners_id_seq'::regclass); ALTER TABLE ONLY clusters_kubernetes_namespaces ALTER COLUMN id SET DEFAULT nextval('clusters_kubernetes_namespaces_id_seq'::regclass); @@ -26915,21 +26845,12 @@ ALTER TABLE ONLY cluster_providers_aws ALTER TABLE ONLY cluster_providers_gcp ADD CONSTRAINT cluster_providers_gcp_pkey PRIMARY KEY (id); -ALTER TABLE ONLY clusters_applications_cilium - ADD CONSTRAINT clusters_applications_cilium_pkey PRIMARY KEY (id); - ALTER TABLE ONLY clusters_applications_helm ADD CONSTRAINT clusters_applications_helm_pkey PRIMARY KEY (id); -ALTER TABLE ONLY clusters_applications_ingress - ADD CONSTRAINT clusters_applications_ingress_pkey PRIMARY KEY (id); - ALTER TABLE ONLY clusters_applications_knative ADD CONSTRAINT clusters_applications_knative_pkey PRIMARY KEY (id); -ALTER TABLE ONLY clusters_applications_prometheus - ADD CONSTRAINT clusters_applications_prometheus_pkey PRIMARY KEY (id); - ALTER TABLE ONLY clusters_applications_runners ADD CONSTRAINT clusters_applications_runners_pkey PRIMARY KEY (id); @@ -30346,16 +30267,10 @@ CREATE INDEX index_cluster_providers_gcp_on_cloud_run ON cluster_providers_gcp U CREATE UNIQUE INDEX index_cluster_providers_gcp_on_cluster_id ON cluster_providers_gcp USING btree (cluster_id); -CREATE UNIQUE INDEX index_clusters_applications_cilium_on_cluster_id ON clusters_applications_cilium USING btree (cluster_id); - CREATE UNIQUE INDEX index_clusters_applications_helm_on_cluster_id ON clusters_applications_helm USING btree (cluster_id); -CREATE UNIQUE INDEX index_clusters_applications_ingress_on_cluster_id ON clusters_applications_ingress USING btree (cluster_id); - CREATE UNIQUE INDEX index_clusters_applications_knative_on_cluster_id ON clusters_applications_knative USING btree (cluster_id); -CREATE UNIQUE INDEX index_clusters_applications_prometheus_on_cluster_id ON clusters_applications_prometheus USING btree (cluster_id); - CREATE UNIQUE INDEX index_clusters_applications_runners_on_cluster_id ON clusters_applications_runners USING btree (cluster_id); CREATE INDEX index_clusters_applications_runners_on_runner_id ON clusters_applications_runners USING btree (runner_id); |
