diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-24 18:11:10 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-24 18:11:10 +0300 |
commit | 958d8a85d32fece017eac7d99bf28860b01a49d8 (patch) | |
tree | 3c84c8447a8d9a6f7ccf7401eeb3cd268570c94f /db | |
parent | 35c5f0c35c83f3c5f8d33fb61713495e29bdec4d (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20210217101901_create_epic_list_user_preferences.rb | 20 | ||||
-rw-r--r-- | db/migrate/20210222085529_add_epic_board_user_preference_user_fk.rb | 19 | ||||
-rw-r--r-- | db/migrate/20210222085551_add_epic_board_user_preference_epic_list_fk.rb | 19 | ||||
-rw-r--r-- | db/schema_migrations/20210217101901 | 1 | ||||
-rw-r--r-- | db/schema_migrations/20210222085529 | 1 | ||||
-rw-r--r-- | db/schema_migrations/20210222085551 | 1 | ||||
-rw-r--r-- | db/structure.sql | 55 |
7 files changed, 105 insertions, 11 deletions
diff --git a/db/migrate/20210217101901_create_epic_list_user_preferences.rb b/db/migrate/20210217101901_create_epic_list_user_preferences.rb new file mode 100644 index 00000000000..5aacea1938d --- /dev/null +++ b/db/migrate/20210217101901_create_epic_list_user_preferences.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +class CreateEpicListUserPreferences < ActiveRecord::Migration[6.0] + DOWNTIME = false + + def up + create_table :boards_epic_list_user_preferences do |t| + t.bigint :user_id, null: false + t.bigint :epic_list_id, index: true, null: false + t.timestamps_with_timezone null: false + t.boolean :collapsed, null: false, default: false + end + + add_index :boards_epic_list_user_preferences, [:user_id, :epic_list_id], unique: true, name: 'index_epic_board_list_preferences_on_user_and_list' + end + + def down + drop_table :boards_epic_list_user_preferences + end +end diff --git a/db/migrate/20210222085529_add_epic_board_user_preference_user_fk.rb b/db/migrate/20210222085529_add_epic_board_user_preference_user_fk.rb new file mode 100644 index 00000000000..52de892a177 --- /dev/null +++ b/db/migrate/20210222085529_add_epic_board_user_preference_user_fk.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class AddEpicBoardUserPreferenceUserFk < ActiveRecord::Migration[6.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + def up + add_concurrent_foreign_key :boards_epic_list_user_preferences, :users, column: :user_id, on_delete: :cascade + end + + def down + with_lock_retries do + remove_foreign_key_if_exists :boards_epic_list_user_preferences, :users + end + end +end diff --git a/db/migrate/20210222085551_add_epic_board_user_preference_epic_list_fk.rb b/db/migrate/20210222085551_add_epic_board_user_preference_epic_list_fk.rb new file mode 100644 index 00000000000..3f62036b899 --- /dev/null +++ b/db/migrate/20210222085551_add_epic_board_user_preference_epic_list_fk.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class AddEpicBoardUserPreferenceEpicListFk < ActiveRecord::Migration[6.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + def up + add_concurrent_foreign_key :boards_epic_list_user_preferences, :boards_epic_lists, column: :epic_list_id, on_delete: :cascade + end + + def down + with_lock_retries do + remove_foreign_key_if_exists :boards_epic_list_user_preferences, :boards_epic_lists + end + end +end diff --git a/db/schema_migrations/20210217101901 b/db/schema_migrations/20210217101901 new file mode 100644 index 00000000000..f4c38be26e0 --- /dev/null +++ b/db/schema_migrations/20210217101901 @@ -0,0 +1 @@ +909aee5ed0ad447fec425f7252fc6dbec827a66ff720620bae1bf3a32536cb96
\ No newline at end of file diff --git a/db/schema_migrations/20210222085529 b/db/schema_migrations/20210222085529 new file mode 100644 index 00000000000..63f47781b3b --- /dev/null +++ b/db/schema_migrations/20210222085529 @@ -0,0 +1 @@ +858cd59ea324e3653801055c7f3fae2152b04ac175945a59faa00d67ae7fa223
\ No newline at end of file diff --git a/db/schema_migrations/20210222085551 b/db/schema_migrations/20210222085551 new file mode 100644 index 00000000000..f0ba3562c3a --- /dev/null +++ b/db/schema_migrations/20210222085551 @@ -0,0 +1 @@ +9e6f99ed0c3d4d76a8c290308805cabf84aa7e5fb6dc2b06d973d9d8726fc4d8
\ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index 6097ff0565b..6c463a668d2 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -9359,39 +9359,39 @@ CREATE TABLE application_settings ( elasticsearch_indexed_file_size_limit_kb integer DEFAULT 1024 NOT NULL, enforce_namespace_storage_limit boolean DEFAULT false NOT NULL, container_registry_delete_tags_service_timeout integer DEFAULT 250 NOT NULL, - kroki_url character varying, - kroki_enabled boolean, - elasticsearch_client_request_timeout integer DEFAULT 0 NOT NULL, gitpod_enabled boolean DEFAULT false NOT NULL, gitpod_url text DEFAULT 'https://gitpod.io/'::text, + elasticsearch_client_request_timeout integer DEFAULT 0 NOT NULL, abuse_notification_email character varying, require_admin_approval_after_user_signup boolean DEFAULT true NOT NULL, help_page_documentation_base_url text, automatic_purchased_storage_allocation boolean DEFAULT false NOT NULL, + container_registry_expiration_policies_worker_capacity integer DEFAULT 0 NOT NULL, encrypted_ci_jwt_signing_key text, encrypted_ci_jwt_signing_key_iv text, - container_registry_expiration_policies_worker_capacity integer DEFAULT 0 NOT NULL, - elasticsearch_analyzers_smartcn_enabled boolean DEFAULT false NOT NULL, - elasticsearch_analyzers_smartcn_search boolean DEFAULT false NOT NULL, - elasticsearch_analyzers_kuromoji_enabled boolean DEFAULT false NOT NULL, - elasticsearch_analyzers_kuromoji_search boolean DEFAULT false NOT NULL, secret_detection_token_revocation_enabled boolean DEFAULT false NOT NULL, secret_detection_token_revocation_url text, encrypted_secret_detection_token_revocation_token text, encrypted_secret_detection_token_revocation_token_iv text, + elasticsearch_analyzers_smartcn_enabled boolean DEFAULT false NOT NULL, + elasticsearch_analyzers_smartcn_search boolean DEFAULT false NOT NULL, + elasticsearch_analyzers_kuromoji_enabled boolean DEFAULT false NOT NULL, + elasticsearch_analyzers_kuromoji_search boolean DEFAULT false NOT NULL, + new_user_signups_cap integer, domain_denylist_enabled boolean DEFAULT false, domain_denylist text, domain_allowlist text, - new_user_signups_cap integer, encrypted_cloud_license_auth_token text, encrypted_cloud_license_auth_token_iv text, secret_detection_revocation_token_types_url text, cloud_license_enabled boolean DEFAULT false NOT NULL, + kroki_url text, + kroki_enabled boolean DEFAULT false NOT NULL, disable_feed_token boolean DEFAULT false NOT NULL, personal_access_token_prefix text, rate_limiting_response_text text, - invisible_captcha_enabled boolean DEFAULT false NOT NULL, container_registry_cleanup_tags_service_max_list_size integer DEFAULT 200 NOT NULL, + invisible_captcha_enabled boolean DEFAULT false NOT NULL, enforce_ssh_key_expiration boolean DEFAULT false NOT NULL, git_two_factor_session_expiry integer DEFAULT 15 NOT NULL, asset_proxy_allowlist text, @@ -9402,7 +9402,7 @@ CREATE TABLE application_settings ( in_product_marketing_emails_enabled boolean DEFAULT true NOT NULL, CONSTRAINT app_settings_container_reg_cleanup_tags_max_list_size_positive CHECK ((container_registry_cleanup_tags_service_max_list_size >= 0)), CONSTRAINT app_settings_registry_exp_policies_worker_capacity_positive CHECK ((container_registry_expiration_policies_worker_capacity >= 0)), - CONSTRAINT check_17d9558205 CHECK ((char_length((kroki_url)::text) <= 1024)), + CONSTRAINT check_17d9558205 CHECK ((char_length(kroki_url) <= 1024)), CONSTRAINT check_2dba05b802 CHECK ((char_length(gitpod_url) <= 255)), CONSTRAINT check_51700b31b5 CHECK ((char_length(default_branch_name) <= 255)), CONSTRAINT check_57123c9593 CHECK ((char_length(help_page_documentation_base_url) <= 255)), @@ -9919,6 +9919,24 @@ CREATE SEQUENCE boards_epic_boards_id_seq ALTER SEQUENCE boards_epic_boards_id_seq OWNED BY boards_epic_boards.id; +CREATE TABLE boards_epic_list_user_preferences ( + id bigint NOT NULL, + user_id bigint NOT NULL, + epic_list_id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + collapsed boolean DEFAULT false NOT NULL +); + +CREATE SEQUENCE boards_epic_list_user_preferences_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE boards_epic_list_user_preferences_id_seq OWNED BY boards_epic_list_user_preferences.id; + CREATE TABLE boards_epic_lists ( id bigint NOT NULL, created_at timestamp with time zone NOT NULL, @@ -18755,6 +18773,8 @@ ALTER TABLE ONLY boards_epic_board_positions ALTER COLUMN id SET DEFAULT nextval ALTER TABLE ONLY boards_epic_boards ALTER COLUMN id SET DEFAULT nextval('boards_epic_boards_id_seq'::regclass); +ALTER TABLE ONLY boards_epic_list_user_preferences ALTER COLUMN id SET DEFAULT nextval('boards_epic_list_user_preferences_id_seq'::regclass); + ALTER TABLE ONLY boards_epic_lists ALTER COLUMN id SET DEFAULT nextval('boards_epic_lists_id_seq'::regclass); ALTER TABLE ONLY boards_epic_user_preferences ALTER COLUMN id SET DEFAULT nextval('boards_epic_user_preferences_id_seq'::regclass); @@ -19834,6 +19854,9 @@ ALTER TABLE ONLY boards_epic_board_positions ALTER TABLE ONLY boards_epic_boards ADD CONSTRAINT boards_epic_boards_pkey PRIMARY KEY (id); +ALTER TABLE ONLY boards_epic_list_user_preferences + ADD CONSTRAINT boards_epic_list_user_preferences_pkey PRIMARY KEY (id); + ALTER TABLE ONLY boards_epic_lists ADD CONSTRAINT boards_epic_lists_pkey PRIMARY KEY (id); @@ -21574,6 +21597,8 @@ CREATE INDEX index_boards_epic_board_positions_on_scoped_relative_position ON bo CREATE INDEX index_boards_epic_boards_on_group_id ON boards_epic_boards USING btree (group_id); +CREATE INDEX index_boards_epic_list_user_preferences_on_epic_list_id ON boards_epic_list_user_preferences USING btree (epic_list_id); + CREATE INDEX index_boards_epic_lists_on_epic_board_id ON boards_epic_lists USING btree (epic_board_id); CREATE UNIQUE INDEX index_boards_epic_lists_on_epic_board_id_and_label_id ON boards_epic_lists USING btree (epic_board_id, label_id) WHERE (list_type = 1); @@ -22098,6 +22123,8 @@ CREATE INDEX index_environments_on_project_id_state_environment_type ON environm CREATE INDEX index_environments_on_state_and_auto_stop_at ON environments USING btree (state, auto_stop_at) WHERE ((auto_stop_at IS NOT NULL) AND ((state)::text = 'available'::text)); +CREATE UNIQUE INDEX index_epic_board_list_preferences_on_user_and_list ON boards_epic_list_user_preferences USING btree (user_id, epic_list_id); + CREATE INDEX index_epic_issues_on_epic_id ON epic_issues USING btree (epic_id); CREATE INDEX index_epic_issues_on_epic_id_and_issue_id ON epic_issues USING btree (epic_id, issue_id); @@ -24510,6 +24537,9 @@ ALTER TABLE ONLY milestones ALTER TABLE ONLY vulnerabilities ADD CONSTRAINT fk_959d40ad0a FOREIGN KEY (confirmed_by_id) REFERENCES users(id) ON DELETE SET NULL; +ALTER TABLE ONLY boards_epic_list_user_preferences + ADD CONSTRAINT fk_95eac55851 FOREIGN KEY (epic_list_id) REFERENCES boards_epic_lists(id) ON DELETE CASCADE; + ALTER TABLE ONLY application_settings ADD CONSTRAINT fk_964370041d FOREIGN KEY (usage_stats_set_by_user_id) REFERENCES users(id) ON DELETE SET NULL; @@ -24810,6 +24840,9 @@ ALTER TABLE ONLY design_management_designs_versions ALTER TABLE ONLY analytics_devops_adoption_segments ADD CONSTRAINT fk_f5aa768998 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; +ALTER TABLE ONLY boards_epic_list_user_preferences + ADD CONSTRAINT fk_f5f2fe5c1f FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; + ALTER TABLE ONLY cluster_agents ADD CONSTRAINT fk_f7d43dee13 FOREIGN KEY (created_by_user_id) REFERENCES users(id) ON DELETE SET NULL; |