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>2021-01-29 06:08:52 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-01-29 06:08:52 +0300
commitf807b28f17f090176ade5d70e5e4a285c9e600be (patch)
tree014aa94bf586e8ad2dc9fbb5a5fc3bf99bd97412 /db
parent5fe1957d2bd0c3f969f357b17f4b46f1968d8810 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20201204111200_create_packages_debian_project_components.rb35
-rw-r--r--db/migrate/20201204111300_create_packages_debian_group_components.rb35
-rw-r--r--db/schema_migrations/202012041112001
-rw-r--r--db/schema_migrations/202012041113001
-rw-r--r--db/structure.sql56
5 files changed, 128 insertions, 0 deletions
diff --git a/db/migrate/20201204111200_create_packages_debian_project_components.rb b/db/migrate/20201204111200_create_packages_debian_project_components.rb
new file mode 100644
index 00000000000..76946967357
--- /dev/null
+++ b/db/migrate/20201204111200_create_packages_debian_project_components.rb
@@ -0,0 +1,35 @@
+# frozen_string_literal: true
+
+class CreatePackagesDebianProjectComponents < ActiveRecord::Migration[5.2]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ UNIQUE_NAME = 'uniq_pkgs_deb_proj_components_on_distribution_id_and_name'
+
+ disable_ddl_transaction!
+
+ def up
+ unless table_exists?(:packages_debian_project_components)
+ create_table :packages_debian_project_components do |t|
+ t.timestamps_with_timezone
+ t.references :distribution,
+ foreign_key: { to_table: :packages_debian_project_distributions, on_delete: :cascade },
+ null: false,
+ index: false
+ t.text :name, null: false
+
+ t.index %w(distribution_id name),
+ name: UNIQUE_NAME,
+ unique: true,
+ using: :btree
+ end
+ end
+
+ add_text_limit :packages_debian_project_components, :name, 255
+ end
+
+ def down
+ drop_table :packages_debian_project_components
+ end
+end
diff --git a/db/migrate/20201204111300_create_packages_debian_group_components.rb b/db/migrate/20201204111300_create_packages_debian_group_components.rb
new file mode 100644
index 00000000000..c69f8d10c2b
--- /dev/null
+++ b/db/migrate/20201204111300_create_packages_debian_group_components.rb
@@ -0,0 +1,35 @@
+# frozen_string_literal: true
+
+class CreatePackagesDebianGroupComponents < ActiveRecord::Migration[5.2]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ UNIQUE_NAME = 'uniq_pkgs_deb_grp_components_on_distribution_id_and_name'
+
+ disable_ddl_transaction!
+
+ def up
+ unless table_exists?(:packages_debian_group_components)
+ create_table :packages_debian_group_components do |t|
+ t.timestamps_with_timezone
+ t.references :distribution,
+ foreign_key: { to_table: :packages_debian_group_distributions, on_delete: :cascade },
+ null: false,
+ index: false
+ t.text :name, null: false
+
+ t.index %w(distribution_id name),
+ name: UNIQUE_NAME,
+ unique: true,
+ using: :btree
+ end
+ end
+
+ add_text_limit :packages_debian_group_components, :name, 255
+ end
+
+ def down
+ drop_table :packages_debian_group_components
+ end
+end
diff --git a/db/schema_migrations/20201204111200 b/db/schema_migrations/20201204111200
new file mode 100644
index 00000000000..34628516bf8
--- /dev/null
+++ b/db/schema_migrations/20201204111200
@@ -0,0 +1 @@
+2aad94b0577882df4fec3df3806993858dad9f4eb20db71c94f8590c6640d62e \ No newline at end of file
diff --git a/db/schema_migrations/20201204111300 b/db/schema_migrations/20201204111300
new file mode 100644
index 00000000000..69a114bed98
--- /dev/null
+++ b/db/schema_migrations/20201204111300
@@ -0,0 +1 @@
+e1265a293640d0d067672cb0426987c4a308025cf5a15b17bac8e30267dc8eaf \ No newline at end of file
diff --git a/db/structure.sql b/db/structure.sql
index c1ee20c4856..d67bd52781d 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -14861,6 +14861,24 @@ CREATE SEQUENCE packages_debian_group_architectures_id_seq
ALTER SEQUENCE packages_debian_group_architectures_id_seq OWNED BY packages_debian_group_architectures.id;
+CREATE TABLE packages_debian_group_components (
+ id bigint NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ distribution_id bigint NOT NULL,
+ name text NOT NULL,
+ CONSTRAINT check_a9bc7d85be CHECK ((char_length(name) <= 255))
+);
+
+CREATE SEQUENCE packages_debian_group_components_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE packages_debian_group_components_id_seq OWNED BY packages_debian_group_components.id;
+
CREATE TABLE packages_debian_group_distributions (
id bigint NOT NULL,
created_at timestamp with time zone NOT NULL,
@@ -14920,6 +14938,24 @@ CREATE SEQUENCE packages_debian_project_architectures_id_seq
ALTER SEQUENCE packages_debian_project_architectures_id_seq OWNED BY packages_debian_project_architectures.id;
+CREATE TABLE packages_debian_project_components (
+ id bigint NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ distribution_id bigint NOT NULL,
+ name text NOT NULL,
+ CONSTRAINT check_517559f298 CHECK ((char_length(name) <= 255))
+);
+
+CREATE SEQUENCE packages_debian_project_components_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE packages_debian_project_components_id_seq OWNED BY packages_debian_project_components.id;
+
CREATE TABLE packages_debian_project_distributions (
id bigint NOT NULL,
created_at timestamp with time zone NOT NULL,
@@ -18917,10 +18953,14 @@ ALTER TABLE ONLY packages_conan_metadata ALTER COLUMN id SET DEFAULT nextval('pa
ALTER TABLE ONLY packages_debian_group_architectures ALTER COLUMN id SET DEFAULT nextval('packages_debian_group_architectures_id_seq'::regclass);
+ALTER TABLE ONLY packages_debian_group_components ALTER COLUMN id SET DEFAULT nextval('packages_debian_group_components_id_seq'::regclass);
+
ALTER TABLE ONLY packages_debian_group_distributions ALTER COLUMN id SET DEFAULT nextval('packages_debian_group_distributions_id_seq'::regclass);
ALTER TABLE ONLY packages_debian_project_architectures ALTER COLUMN id SET DEFAULT nextval('packages_debian_project_architectures_id_seq'::regclass);
+ALTER TABLE ONLY packages_debian_project_components ALTER COLUMN id SET DEFAULT nextval('packages_debian_project_components_id_seq'::regclass);
+
ALTER TABLE ONLY packages_debian_project_distributions ALTER COLUMN id SET DEFAULT nextval('packages_debian_project_distributions_id_seq'::regclass);
ALTER TABLE ONLY packages_dependencies ALTER COLUMN id SET DEFAULT nextval('packages_dependencies_id_seq'::regclass);
@@ -20286,12 +20326,18 @@ ALTER TABLE ONLY packages_debian_file_metadata
ALTER TABLE ONLY packages_debian_group_architectures
ADD CONSTRAINT packages_debian_group_architectures_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY packages_debian_group_components
+ ADD CONSTRAINT packages_debian_group_components_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY packages_debian_group_distributions
ADD CONSTRAINT packages_debian_group_distributions_pkey PRIMARY KEY (id);
ALTER TABLE ONLY packages_debian_project_architectures
ADD CONSTRAINT packages_debian_project_architectures_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY packages_debian_project_components
+ ADD CONSTRAINT packages_debian_project_components_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY packages_debian_project_distributions
ADD CONSTRAINT packages_debian_project_distributions_pkey PRIMARY KEY (id);
@@ -23463,8 +23509,12 @@ CREATE INDEX tmp_index_on_vulnerabilities_non_dismissed ON vulnerabilities USING
CREATE UNIQUE INDEX uniq_pkgs_deb_grp_architectures_on_distribution_id_and_name ON packages_debian_group_architectures USING btree (distribution_id, name);
+CREATE UNIQUE INDEX uniq_pkgs_deb_grp_components_on_distribution_id_and_name ON packages_debian_group_components USING btree (distribution_id, name);
+
CREATE UNIQUE INDEX uniq_pkgs_deb_proj_architectures_on_distribution_id_and_name ON packages_debian_project_architectures USING btree (distribution_id, name);
+CREATE UNIQUE INDEX uniq_pkgs_deb_proj_components_on_distribution_id_and_name ON packages_debian_project_components USING btree (distribution_id, name);
+
CREATE UNIQUE INDEX uniq_pkgs_debian_group_distributions_group_id_and_codename ON packages_debian_group_distributions USING btree (group_id, codename);
CREATE UNIQUE INDEX uniq_pkgs_debian_group_distributions_group_id_and_suite ON packages_debian_group_distributions USING btree (group_id, suite);
@@ -25324,6 +25374,9 @@ ALTER TABLE ONLY users_ops_dashboard_projects
ALTER TABLE ONLY project_incident_management_settings
ADD CONSTRAINT fk_rails_9c2ea1b7dd FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+ALTER TABLE ONLY packages_debian_project_components
+ ADD CONSTRAINT fk_rails_9d072b5073 FOREIGN KEY (distribution_id) REFERENCES packages_debian_project_distributions(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY gpg_keys
ADD CONSTRAINT fk_rails_9d1f5d8719 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
@@ -25786,6 +25839,9 @@ ALTER TABLE ONLY board_group_recent_visits
ALTER TABLE ONLY resource_state_events
ADD CONSTRAINT fk_rails_f5827a7ccd FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL;
+ALTER TABLE ONLY packages_debian_group_components
+ ADD CONSTRAINT fk_rails_f5f1ef54c6 FOREIGN KEY (distribution_id) REFERENCES packages_debian_group_distributions(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY incident_management_oncall_shifts
ADD CONSTRAINT fk_rails_f6eef06841 FOREIGN KEY (participant_id) REFERENCES incident_management_oncall_participants(id) ON DELETE CASCADE;