summaryrefslogtreecommitdiff
path: root/db/schema.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-10-22 11:31:16 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-10-22 11:31:16 +0000
commit905c1110b08f93a19661cf42a276c7ea90d0a0ff (patch)
tree756d138db422392c00471ab06acdff92c5a9b69c /db/schema.rb
parent50d93f8d1686950fc58dda4823c4835fd0d8c14b (diff)
downloadgitlab-ce-905c1110b08f93a19661cf42a276c7ea90d0a0ff.tar.gz
Add latest changes from gitlab-org/gitlab@12-4-stable-ee
Diffstat (limited to 'db/schema.rb')
-rw-r--r--db/schema.rb264
1 files changed, 254 insertions, 10 deletions
diff --git a/db/schema.rb b/db/schema.rb
index 09f27d2f9cb..f3a2b4608f5 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema.define(version: 2019_09_18_104222) do
+ActiveRecord::Schema.define(version: 2019_10_16_220135) do
# These are extensions that must be enabled in order to support this database
enable_extension "pg_trgm"
@@ -93,6 +93,30 @@ ActiveRecord::Schema.define(version: 2019_09_18_104222) do
t.index ["project_id"], name: "analytics_repository_languages_on_project_id"
end
+ create_table "analytics_repository_file_commits", force: :cascade do |t|
+ t.bigint "analytics_repository_file_id", null: false
+ t.bigint "project_id", null: false
+ t.date "committed_date", null: false
+ t.integer "commit_count", limit: 2, null: false
+ t.index ["analytics_repository_file_id"], name: "index_analytics_repository_file_commits_file_id"
+ t.index ["project_id", "committed_date", "analytics_repository_file_id"], name: "index_file_commits_on_committed_date_file_id_and_project_id", unique: true
+ end
+
+ create_table "analytics_repository_file_edits", force: :cascade do |t|
+ t.bigint "project_id", null: false
+ t.bigint "analytics_repository_file_id", null: false
+ t.date "committed_date", null: false
+ t.integer "num_edits", default: 0, null: false
+ t.index ["analytics_repository_file_id", "committed_date", "project_id"], name: "index_file_edits_on_committed_date_file_id_and_project_id", unique: true
+ t.index ["project_id"], name: "index_analytics_repository_file_edits_on_project_id"
+ end
+
+ create_table "analytics_repository_files", force: :cascade do |t|
+ t.bigint "project_id", null: false
+ t.string "file_path", limit: 4096, null: false
+ t.index ["project_id", "file_path"], name: "index_analytics_repository_files_on_project_id_and_file_path", unique: true
+ end
+
create_table "appearances", id: :serial, force: :cascade do |t|
t.string "title", null: false
t.text "description", null: false
@@ -307,6 +331,16 @@ ActiveRecord::Schema.define(version: 2019_09_18_104222) do
t.string "encrypted_asset_proxy_secret_key_iv"
t.string "static_objects_external_storage_url", limit: 255
t.string "static_objects_external_storage_auth_token", limit: 255
+ t.boolean "throttle_protected_paths_enabled", default: true, null: false
+ t.integer "throttle_protected_paths_requests_per_period", default: 10, null: false
+ t.integer "throttle_protected_paths_period_in_seconds", default: 60, null: false
+ t.string "protected_paths", limit: 255, default: ["/users/password", "/users/sign_in", "/api/v3/session.json", "/api/v3/session", "/api/v4/session.json", "/api/v4/session", "/users", "/users/confirmation", "/unsubscribes/", "/import/github/personal_access_token"], array: true
+ t.boolean "throttle_incident_management_notification_enabled", default: false, null: false
+ t.integer "throttle_incident_management_notification_period_in_seconds", default: 3600
+ t.integer "throttle_incident_management_notification_per_period", default: 3600
+ t.integer "push_event_hooks_limit", default: 3, null: false
+ t.integer "push_event_activities_limit", default: 3, null: false
+ t.string "custom_http_clone_url_root", limit: 511
t.index ["custom_project_templates_group_id"], name: "index_application_settings_on_custom_project_templates_group_id"
t.index ["file_template_project_id"], name: "index_application_settings_on_file_template_project_id"
t.index ["instance_administration_project_id"], name: "index_applicationsettings_on_instance_administration_project_id"
@@ -435,6 +469,15 @@ ActiveRecord::Schema.define(version: 2019_09_18_104222) do
t.index ["user_id", "name"], name: "index_award_emoji_on_user_id_and_name"
end
+ create_table "aws_roles", primary_key: "user_id", id: :integer, default: nil, force: :cascade do |t|
+ t.datetime_with_timezone "created_at", null: false
+ t.datetime_with_timezone "updated_at", null: false
+ t.string "role_arn", limit: 2048, null: false
+ t.string "role_external_id", limit: 64, null: false
+ t.index ["role_external_id"], name: "index_aws_roles_on_role_external_id", unique: true
+ t.index ["user_id"], name: "index_aws_roles_on_user_id", unique: true
+ end
+
create_table "badges", id: :serial, force: :cascade do |t|
t.string "link_url", null: false
t.string "image_url", null: false
@@ -624,6 +667,7 @@ ActiveRecord::Schema.define(version: 2019_09_18_104222) do
t.index ["name"], name: "index_ci_builds_on_name_for_security_products_values", where: "((name)::text = ANY (ARRAY[('container_scanning'::character varying)::text, ('dast'::character varying)::text, ('dependency_scanning'::character varying)::text, ('license_management'::character varying)::text, ('sast'::character varying)::text]))"
t.index ["project_id", "id"], name: "index_ci_builds_on_project_id_and_id"
t.index ["project_id", "status"], name: "index_ci_builds_project_id_and_status_for_live_jobs_partial2", where: "(((type)::text = 'Ci::Build'::text) AND ((status)::text = ANY (ARRAY[('running'::character varying)::text, ('pending'::character varying)::text, ('created'::character varying)::text])))"
+ t.index ["project_id"], name: "index_ci_builds_on_project_id_for_successfull_pages_deploy", where: "(((type)::text = 'GenericCommitStatus'::text) AND ((stage)::text = 'deploy'::text) AND ((name)::text = 'pages:deploy'::text) AND ((status)::text = 'success'::text))"
t.index ["protected"], name: "index_ci_builds_on_protected"
t.index ["queued_at"], name: "index_ci_builds_on_queued_at"
t.index ["runner_id"], name: "index_ci_builds_on_runner_id"
@@ -874,7 +918,7 @@ ActiveRecord::Schema.define(version: 2019_09_18_104222) do
t.datetime "updated_at"
t.integer "commit_id"
t.index ["commit_id"], name: "index_ci_trigger_requests_on_commit_id"
- t.index ["trigger_id"], name: "index_ci_trigger_requests_on_trigger_id"
+ t.index ["trigger_id", "id"], name: "index_ci_trigger_requests_on_trigger_id_and_id", order: { id: :desc }
end
create_table "ci_triggers", id: :serial, force: :cascade do |t|
@@ -935,6 +979,30 @@ ActiveRecord::Schema.define(version: 2019_09_18_104222) do
t.index ["project_id"], name: "index_cluster_projects_on_project_id"
end
+ create_table "cluster_providers_aws", force: :cascade do |t|
+ t.bigint "cluster_id", null: false
+ t.integer "created_by_user_id"
+ t.integer "num_nodes", null: false
+ t.integer "status", null: false
+ t.datetime_with_timezone "created_at", null: false
+ t.datetime_with_timezone "updated_at", null: false
+ t.string "key_name", limit: 255, null: false
+ t.string "role_arn", limit: 2048, null: false
+ t.string "region", limit: 255, null: false
+ t.string "vpc_id", limit: 255, null: false
+ t.string "subnet_ids", limit: 255, default: [], null: false, array: true
+ t.string "security_group_id", limit: 255, null: false
+ t.string "instance_type", limit: 255, null: false
+ t.string "access_key_id", limit: 255
+ t.string "encrypted_secret_access_key_iv", limit: 255
+ t.text "encrypted_secret_access_key"
+ t.text "session_token"
+ t.text "status_reason"
+ t.index ["cluster_id", "status"], name: "index_cluster_providers_aws_on_cluster_id_and_status"
+ t.index ["cluster_id"], name: "index_cluster_providers_aws_on_cluster_id", unique: true
+ t.index ["created_by_user_id"], name: "index_cluster_providers_aws_on_created_by_user_id"
+ end
+
create_table "cluster_providers_gcp", id: :serial, force: :cascade do |t|
t.integer "cluster_id", null: false
t.integer "status"
@@ -950,6 +1018,8 @@ ActiveRecord::Schema.define(version: 2019_09_18_104222) do
t.text "encrypted_access_token"
t.string "encrypted_access_token_iv"
t.boolean "legacy_abac", default: false, null: false
+ t.boolean "cloud_run", default: false, null: false
+ t.index ["cloud_run"], name: "index_cluster_providers_gcp_on_cloud_run"
t.index ["cluster_id"], name: "index_cluster_providers_gcp_on_cluster_id", unique: true
end
@@ -966,7 +1036,9 @@ ActiveRecord::Schema.define(version: 2019_09_18_104222) do
t.string "domain"
t.boolean "managed", default: true, null: false
t.boolean "namespace_per_environment", default: true, null: false
+ t.integer "management_project_id"
t.index ["enabled"], name: "index_clusters_on_enabled"
+ t.index ["management_project_id"], name: "index_clusters_on_management_project_id", where: "(management_project_id IS NOT NULL)"
t.index ["user_id"], name: "index_clusters_on_user_id"
end
@@ -1194,9 +1266,21 @@ ActiveRecord::Schema.define(version: 2019_09_18_104222) do
t.index ["project_id", "status"], name: "index_deployments_on_project_id_and_status"
end
+ create_table "description_versions", force: :cascade do |t|
+ t.datetime_with_timezone "created_at", null: false
+ t.datetime_with_timezone "updated_at", null: false
+ t.integer "issue_id"
+ t.integer "merge_request_id"
+ t.integer "epic_id"
+ t.text "description"
+ t.index ["epic_id"], name: "index_description_versions_on_epic_id", where: "(epic_id IS NOT NULL)"
+ t.index ["issue_id"], name: "index_description_versions_on_issue_id", where: "(issue_id IS NOT NULL)"
+ t.index ["merge_request_id"], name: "index_description_versions_on_merge_request_id", where: "(merge_request_id IS NOT NULL)"
+ end
+
create_table "design_management_designs", force: :cascade do |t|
t.integer "project_id", null: false
- t.integer "issue_id", null: false
+ t.integer "issue_id"
t.string "filename", null: false
t.index ["issue_id", "filename"], name: "index_design_management_designs_on_issue_id_and_filename", unique: true
t.index ["project_id"], name: "index_design_management_designs_on_project_id"
@@ -1215,8 +1299,11 @@ ActiveRecord::Schema.define(version: 2019_09_18_104222) do
create_table "design_management_versions", force: :cascade do |t|
t.binary "sha", null: false
t.bigint "issue_id"
+ t.integer "user_id"
+ t.datetime_with_timezone "created_at"
t.index ["issue_id"], name: "index_design_management_versions_on_issue_id"
t.index ["sha", "issue_id"], name: "index_design_management_versions_on_sha_and_issue_id", unique: true
+ t.index ["user_id"], name: "index_design_management_versions_on_user_id", where: "(user_id IS NOT NULL)"
end
create_table "draft_notes", force: :cascade do |t|
@@ -1350,6 +1437,15 @@ ActiveRecord::Schema.define(version: 2019_09_18_104222) do
t.index ["target_type", "target_id"], name: "index_events_on_target_type_and_target_id"
end
+ create_table "evidences", force: :cascade do |t|
+ t.bigint "release_id", null: false
+ t.datetime_with_timezone "created_at", null: false
+ t.datetime_with_timezone "updated_at", null: false
+ t.binary "summary_sha"
+ t.jsonb "summary", default: {}, null: false
+ t.index ["release_id"], name: "index_evidences_on_release_id"
+ end
+
create_table "external_pull_requests", force: :cascade do |t|
t.datetime_with_timezone "created_at", null: false
t.datetime_with_timezone "updated_at", null: false
@@ -1679,6 +1775,16 @@ ActiveRecord::Schema.define(version: 2019_09_18_104222) do
t.index ["project_id"], name: "index_gpg_signatures_on_project_id"
end
+ create_table "grafana_integrations", force: :cascade do |t|
+ t.bigint "project_id", null: false
+ t.datetime_with_timezone "created_at", null: false
+ t.datetime_with_timezone "updated_at", null: false
+ t.string "encrypted_token", limit: 255, null: false
+ t.string "encrypted_token_iv", limit: 255, null: false
+ t.string "grafana_url", limit: 1024, null: false
+ t.index ["project_id"], name: "index_grafana_integrations_on_project_id"
+ end
+
create_table "group_custom_attributes", id: :serial, force: :cascade do |t|
t.datetime_with_timezone "created_at", null: false
t.datetime_with_timezone "updated_at", null: false
@@ -1778,6 +1884,7 @@ ActiveRecord::Schema.define(version: 2019_09_18_104222) do
t.datetime "first_added_to_board_at"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
+ t.index ["issue_id", "first_mentioned_in_commit_at", "first_associated_with_milestone_at", "first_added_to_board_at"], name: "index_issue_metrics_on_issue_id_and_timestamps"
t.index ["issue_id"], name: "index_issue_metrics"
end
@@ -1821,7 +1928,7 @@ ActiveRecord::Schema.define(version: 2019_09_18_104222) do
t.boolean "discussion_locked"
t.datetime_with_timezone "closed_at"
t.integer "closed_by_id"
- t.integer "state_id", limit: 2
+ t.integer "state_id", limit: 2, default: 1, null: false
t.integer "duplicated_to_id"
t.index ["author_id"], name: "index_issues_on_author_id"
t.index ["closed_by_id"], name: "index_issues_on_closed_by_id"
@@ -1831,17 +1938,40 @@ ActiveRecord::Schema.define(version: 2019_09_18_104222) do
t.index ["milestone_id"], name: "index_issues_on_milestone_id"
t.index ["moved_to_id"], name: "index_issues_on_moved_to_id", where: "(moved_to_id IS NOT NULL)"
t.index ["project_id", "created_at", "id", "state"], name: "index_issues_on_project_id_and_created_at_and_id_and_state"
+ t.index ["project_id", "created_at", "id", "state_id"], name: "idx_issues_on_project_id_and_created_at_and_id_and_state_id"
t.index ["project_id", "due_date", "id", "state"], name: "idx_issues_on_project_id_and_due_date_and_id_and_state_partial", where: "(due_date IS NOT NULL)"
+ t.index ["project_id", "due_date", "id", "state_id"], name: "idx_issues_on_project_id_and_due_date_and_id_and_state_id", where: "(due_date IS NOT NULL)"
t.index ["project_id", "iid"], name: "index_issues_on_project_id_and_iid", unique: true
t.index ["project_id", "relative_position", "state", "id"], name: "index_issues_on_project_id_and_rel_position_and_state_and_id", order: { id: :desc }
+ t.index ["project_id", "relative_position", "state_id", "id"], name: "idx_issues_on_project_id_and_rel_position_and_state_id_and_id", order: { id: :desc }
t.index ["project_id", "updated_at", "id", "state"], name: "index_issues_on_project_id_and_updated_at_and_id_and_state"
+ t.index ["project_id", "updated_at", "id", "state_id"], name: "idx_issues_on_project_id_and_updated_at_and_id_and_state_id"
t.index ["relative_position"], name: "index_issues_on_relative_position"
t.index ["state"], name: "index_issues_on_state"
+ t.index ["state_id"], name: "idx_issues_on_state_id"
t.index ["title"], name: "index_issues_on_title_trigram", opclass: :gin_trgm_ops, using: :gin
t.index ["updated_at"], name: "index_issues_on_updated_at"
t.index ["updated_by_id"], name: "index_issues_on_updated_by_id", where: "(updated_by_id IS NOT NULL)"
end
+ create_table "issues_prometheus_alert_events", id: false, force: :cascade do |t|
+ t.bigint "issue_id", null: false
+ t.bigint "prometheus_alert_event_id", null: false
+ t.datetime_with_timezone "created_at", null: false
+ t.datetime_with_timezone "updated_at", null: false
+ t.index ["issue_id", "prometheus_alert_event_id"], name: "issue_id_prometheus_alert_event_id_index", unique: true
+ t.index ["prometheus_alert_event_id"], name: "issue_id_issues_prometheus_alert_events_index"
+ end
+
+ create_table "issues_self_managed_prometheus_alert_events", id: false, force: :cascade do |t|
+ t.bigint "issue_id", null: false
+ t.bigint "self_managed_prometheus_alert_event_id", null: false
+ t.datetime_with_timezone "created_at", null: false
+ t.datetime_with_timezone "updated_at", null: false
+ t.index ["issue_id", "self_managed_prometheus_alert_event_id"], name: "issue_id_self_managed_prometheus_alert_event_id_index", unique: true
+ t.index ["self_managed_prometheus_alert_event_id"], name: "issue_id_issues_self_managed_rometheus_alert_events_index"
+ end
+
create_table "jira_connect_installations", force: :cascade do |t|
t.string "client_key"
t.string "encrypted_shared_secret"
@@ -1997,6 +2127,7 @@ ActiveRecord::Schema.define(version: 2019_09_18_104222) do
t.datetime "updated_at", null: false
t.integer "user_id"
t.integer "milestone_id"
+ t.integer "max_issue_count", default: 0, null: false
t.index ["board_id", "label_id"], name: "index_lists_on_board_id_and_label_id", unique: true
t.index ["label_id"], name: "index_lists_on_label_id"
t.index ["list_type"], name: "index_lists_on_list_type"
@@ -2162,22 +2293,27 @@ ActiveRecord::Schema.define(version: 2019_09_18_104222) do
t.boolean "discussion_locked"
t.integer "latest_merge_request_diff_id"
t.boolean "allow_maintainer_to_push"
- t.integer "state_id", limit: 2
+ t.integer "state_id", limit: 2, default: 1, null: false
t.string "rebase_jid"
t.index ["assignee_id"], name: "index_merge_requests_on_assignee_id"
t.index ["author_id"], name: "index_merge_requests_on_author_id"
t.index ["created_at"], name: "index_merge_requests_on_created_at"
t.index ["description"], name: "index_merge_requests_on_description_trigram", opclass: :gin_trgm_ops, using: :gin
t.index ["head_pipeline_id"], name: "index_merge_requests_on_head_pipeline_id"
+ t.index ["id", "merge_jid"], name: "idx_merge_requests_on_id_and_merge_jid", where: "((merge_jid IS NOT NULL) AND (state_id = 4))"
t.index ["id", "merge_jid"], name: "index_merge_requests_on_id_and_merge_jid", where: "((merge_jid IS NOT NULL) AND ((state)::text = 'locked'::text))"
t.index ["latest_merge_request_diff_id"], name: "index_merge_requests_on_latest_merge_request_diff_id"
t.index ["merge_user_id"], name: "index_merge_requests_on_merge_user_id", where: "(merge_user_id IS NOT NULL)"
t.index ["milestone_id"], name: "index_merge_requests_on_milestone_id"
t.index ["source_branch"], name: "index_merge_requests_on_source_branch"
+ t.index ["source_project_id", "source_branch"], name: "idx_merge_requests_on_source_project_and_branch_state_opened", where: "(state_id = 1)"
t.index ["source_project_id", "source_branch"], name: "index_merge_requests_on_source_project_and_branch_state_opened", where: "((state)::text = 'opened'::text)"
t.index ["source_project_id", "source_branch"], name: "index_merge_requests_on_source_project_id_and_source_branch"
t.index ["state", "merge_status"], name: "index_merge_requests_on_state_and_merge_status", where: "(((state)::text = 'opened'::text) AND ((merge_status)::text = 'can_be_merged'::text))"
+ t.index ["state_id", "merge_status"], name: "idx_merge_requests_on_state_id_and_merge_status", where: "((state_id = 1) AND ((merge_status)::text = 'can_be_merged'::text))"
t.index ["target_branch"], name: "index_merge_requests_on_target_branch"
+ t.index ["target_project_id", "created_at"], name: "index_merge_requests_target_project_id_created_at"
+ t.index ["target_project_id", "iid"], name: "idx_merge_requests_on_target_project_id_and_iid_opened", where: "(state_id = 1)"
t.index ["target_project_id", "iid"], name: "index_merge_requests_on_target_project_id_and_iid", unique: true
t.index ["target_project_id", "iid"], name: "index_merge_requests_on_target_project_id_and_iid_opened", where: "((state)::text = 'opened'::text)"
t.index ["target_project_id", "merge_commit_sha", "id"], name: "index_merge_requests_on_tp_id_and_merge_commit_sha_and_id"
@@ -2272,7 +2408,7 @@ ActiveRecord::Schema.define(version: 2019_09_18_104222) do
t.boolean "membership_lock", default: false
t.boolean "share_with_group_lock", default: false
t.integer "visibility_level", default: 20, null: false
- t.boolean "request_access_enabled", default: false, null: false
+ t.boolean "request_access_enabled", default: true, null: false
t.string "ldap_sync_status", default: "ready", null: false
t.string "ldap_sync_error"
t.datetime "ldap_sync_last_update_at"
@@ -2300,6 +2436,8 @@ ActiveRecord::Schema.define(version: 2019_09_18_104222) do
t.integer "last_ci_minutes_usage_notification_level"
t.integer "subgroup_creation_level", default: 1
t.boolean "emails_disabled"
+ t.integer "max_pages_size"
+ t.integer "max_artifacts_size"
t.index ["created_at"], name: "index_namespaces_on_created_at"
t.index ["custom_project_templates_group_id", "type"], name: "index_namespaces_on_custom_project_templates_group_id_and_type", where: "(custom_project_templates_group_id IS NOT NULL)"
t.index ["file_template_project_id"], name: "index_namespaces_on_file_template_project_id"
@@ -2393,6 +2531,7 @@ ActiveRecord::Schema.define(version: 2019_09_18_104222) do
t.boolean "issue_due"
t.boolean "new_epic"
t.string "notification_email"
+ t.boolean "new_release"
t.index ["source_id", "source_type"], name: "index_notification_settings_on_source_id_and_source_type"
t.index ["user_id", "source_id", "source_type"], name: "index_notifications_on_user_id_and_source_id_and_source_type", unique: true
t.index ["user_id"], name: "index_notification_settings_on_user_id"
@@ -2518,6 +2657,7 @@ ActiveRecord::Schema.define(version: 2019_09_18_104222) do
t.string "name", null: false
t.string "version"
t.integer "package_type", limit: 2, null: false
+ t.index ["name"], name: "index_packages_packages_on_name_trigram", opclass: :gin_trgm_ops, using: :gin
t.index ["project_id"], name: "index_packages_packages_on_project_id"
end
@@ -2757,6 +2897,13 @@ ActiveRecord::Schema.define(version: 2019_09_18_104222) do
t.index ["status"], name: "index_project_mirror_data_on_status"
end
+ create_table "project_pages_metadata", id: false, force: :cascade do |t|
+ t.bigint "project_id", null: false
+ t.boolean "deployed", default: false, null: false
+ t.index ["project_id"], name: "index_project_pages_metadata_on_project_id", unique: true
+ t.index ["project_id"], name: "index_project_pages_metadata_on_project_id_and_deployed_is_true", where: "(deployed = true)"
+ end
+
create_table "project_repositories", force: :cascade do |t|
t.integer "shard_id", null: false
t.string "disk_path", null: false
@@ -2851,7 +2998,7 @@ ActiveRecord::Schema.define(version: 2019_09_18_104222) do
t.boolean "has_external_issue_tracker"
t.string "repository_storage", default: "default", null: false
t.boolean "repository_read_only"
- t.boolean "request_access_enabled", default: false, null: false
+ t.boolean "request_access_enabled", default: true, null: false
t.boolean "has_external_wiki"
t.string "ci_config_path"
t.boolean "lfs_enabled"
@@ -2885,6 +3032,10 @@ ActiveRecord::Schema.define(version: 2019_09_18_104222) do
t.boolean "merge_requests_disable_committers_approval"
t.boolean "require_password_to_approve"
t.boolean "emails_disabled"
+ t.integer "max_pages_size"
+ t.integer "max_artifacts_size"
+ t.string "pull_mirror_branch_prefix", limit: 50
+ t.index "lower((name)::text)", name: "index_projects_on_lower_name"
t.index ["archived", "pending_delete", "merge_requests_require_code_owner_approval"], name: "projects_requiring_code_owner_approval", where: "((pending_delete = false) AND (archived = false) AND (merge_requests_require_code_owner_approval = true))"
t.index ["created_at"], name: "index_projects_on_created_at"
t.index ["creator_id"], name: "index_projects_on_creator_id"
@@ -3049,6 +3200,7 @@ ActiveRecord::Schema.define(version: 2019_09_18_104222) do
t.binary "commit_to"
t.text "ref"
t.string "commit_title", limit: 70
+ t.integer "ref_count"
t.index ["event_id"], name: "index_push_event_payloads_on_event_id", unique: true
end
@@ -3081,6 +3233,7 @@ ActiveRecord::Schema.define(version: 2019_09_18_104222) do
t.string "path", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
+ t.index "lower((path)::text) varchar_pattern_ops", name: "index_redirect_routes_on_path_unique_text_pattern_ops", unique: true
t.index ["path"], name: "index_redirect_routes_on_path", unique: true
t.index ["source_type", "source_id"], name: "index_redirect_routes_on_source_type_and_source_id"
end
@@ -3099,8 +3252,8 @@ ActiveRecord::Schema.define(version: 2019_09_18_104222) do
t.string "tag"
t.text "description"
t.integer "project_id"
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
t.text "description_html"
t.integer "cached_markdown_version"
t.integer "author_id"
@@ -3197,6 +3350,19 @@ ActiveRecord::Schema.define(version: 2019_09_18_104222) do
t.index ["group_id", "token_encrypted"], name: "index_scim_oauth_access_tokens_on_group_id_and_token_encrypted", unique: true
end
+ create_table "self_managed_prometheus_alert_events", force: :cascade do |t|
+ t.bigint "project_id", null: false
+ t.bigint "environment_id"
+ t.datetime_with_timezone "started_at", null: false
+ t.datetime_with_timezone "ended_at"
+ t.integer "status", limit: 2, null: false
+ t.string "title", limit: 255, null: false
+ t.string "query_expression", limit: 255
+ t.string "payload_key", limit: 255, null: false
+ t.index ["environment_id"], name: "index_self_managed_prometheus_alert_events_on_environment_id"
+ t.index ["project_id", "payload_key"], name: "idx_project_id_payload_key_self_managed_prometheus_alert_events", unique: true
+ end
+
create_table "sent_notifications", id: :serial, force: :cascade do |t|
t.integer "project_id"
t.integer "noteable_id"
@@ -3281,8 +3447,9 @@ ActiveRecord::Schema.define(version: 2019_09_18_104222) do
t.text "description"
t.text "description_html"
t.index ["author_id"], name: "index_snippets_on_author_id"
+ t.index ["content"], name: "index_snippets_on_content_trigram", opclass: :gin_trgm_ops, using: :gin
t.index ["file_name"], name: "index_snippets_on_file_name_trigram", opclass: :gin_trgm_ops, using: :gin
- t.index ["project_id"], name: "index_snippets_on_project_id"
+ t.index ["project_id", "visibility_level"], name: "index_snippets_on_project_id_and_visibility_level"
t.index ["title"], name: "index_snippets_on_title_trigram", opclass: :gin_trgm_ops, using: :gin
t.index ["updated_at"], name: "index_snippets_on_updated_at"
t.index ["visibility_level"], name: "index_snippets_on_visibility_level"
@@ -3298,7 +3465,9 @@ ActiveRecord::Schema.define(version: 2019_09_18_104222) do
create_table "software_licenses", id: :serial, force: :cascade do |t|
t.string "name", null: false
+ t.string "spdx_identifier", limit: 255
t.index ["name"], name: "index_software_licenses_on_name"
+ t.index ["spdx_identifier"], name: "index_software_licenses_on_spdx_identifier"
end
create_table "spam_logs", id: :serial, force: :cascade do |t|
@@ -3346,6 +3515,8 @@ ActiveRecord::Schema.define(version: 2019_09_18_104222) do
t.string "action"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
+ t.bigint "description_version_id"
+ t.index ["description_version_id"], name: "index_system_note_metadata_on_description_version_id", unique: true, where: "(description_version_id IS NOT NULL)"
t.index ["note_id"], name: "index_system_note_metadata_on_note_id", unique: true
end
@@ -3609,6 +3780,8 @@ ActiveRecord::Schema.define(version: 2019_09_18_104222) do
t.string "first_name", limit: 255
t.string "last_name", limit: 255
t.string "static_object_token", limit: 255
+ t.integer "role", limit: 2
+ t.index "lower((name)::text)", name: "index_on_users_name_lower"
t.index ["accepted_term_id"], name: "index_users_on_accepted_term_id"
t.index ["admin"], name: "index_users_on_admin"
t.index ["bot_type"], name: "index_users_on_bot_type"
@@ -3652,6 +3825,42 @@ ActiveRecord::Schema.define(version: 2019_09_18_104222) do
t.index ["user_id", "project_id"], name: "index_users_star_projects_on_user_id_and_project_id", unique: true
end
+ create_table "vulnerabilities", force: :cascade do |t|
+ t.bigint "milestone_id"
+ t.bigint "epic_id"
+ t.bigint "project_id", null: false
+ t.bigint "author_id", null: false
+ t.bigint "updated_by_id"
+ t.bigint "last_edited_by_id"
+ t.date "start_date"
+ t.date "due_date"
+ t.datetime_with_timezone "last_edited_at"
+ t.datetime_with_timezone "created_at", null: false
+ t.datetime_with_timezone "updated_at", null: false
+ t.string "title", limit: 255, null: false
+ t.text "title_html", null: false
+ t.text "description"
+ t.text "description_html"
+ t.bigint "start_date_sourcing_milestone_id"
+ t.bigint "due_date_sourcing_milestone_id"
+ t.bigint "closed_by_id"
+ t.datetime_with_timezone "closed_at"
+ t.integer "state", limit: 2, default: 1, null: false
+ t.integer "severity", limit: 2, null: false
+ t.boolean "severity_overridden", default: false
+ t.integer "confidence", limit: 2, null: false
+ t.boolean "confidence_overridden", default: false
+ t.index ["author_id"], name: "index_vulnerabilities_on_author_id"
+ t.index ["closed_by_id"], name: "index_vulnerabilities_on_closed_by_id"
+ t.index ["due_date_sourcing_milestone_id"], name: "index_vulnerabilities_on_due_date_sourcing_milestone_id"
+ t.index ["epic_id"], name: "index_vulnerabilities_on_epic_id"
+ t.index ["last_edited_by_id"], name: "index_vulnerabilities_on_last_edited_by_id"
+ t.index ["milestone_id"], name: "index_vulnerabilities_on_milestone_id"
+ t.index ["project_id"], name: "index_vulnerabilities_on_project_id"
+ t.index ["start_date_sourcing_milestone_id"], name: "index_vulnerabilities_on_start_date_sourcing_milestone_id"
+ t.index ["updated_by_id"], name: "index_vulnerabilities_on_updated_by_id"
+ end
+
create_table "vulnerability_feedback", id: :serial, force: :cascade do |t|
t.datetime_with_timezone "created_at", null: false
t.datetime_with_timezone "updated_at", null: false
@@ -3719,10 +3928,12 @@ ActiveRecord::Schema.define(version: 2019_09_18_104222) do
t.string "name", null: false
t.string "metadata_version", null: false
t.text "raw_metadata", null: false
+ t.bigint "vulnerability_id"
t.index ["primary_identifier_id"], name: "index_vulnerability_occurrences_on_primary_identifier_id"
t.index ["project_id", "primary_identifier_id", "location_fingerprint", "scanner_id"], name: "index_vulnerability_occurrences_on_unique_keys", unique: true
t.index ["scanner_id"], name: "index_vulnerability_occurrences_on_scanner_id"
t.index ["uuid"], name: "index_vulnerability_occurrences_on_uuid", unique: true
+ t.index ["vulnerability_id"], name: "index_vulnerability_occurrences_on_vulnerability_id"
end
create_table "vulnerability_scanners", force: :cascade do |t|
@@ -3789,6 +4000,11 @@ ActiveRecord::Schema.define(version: 2019_09_18_104222) do
add_foreign_key "analytics_cycle_analytics_project_stages", "projects", on_delete: :cascade
add_foreign_key "analytics_language_trend_repository_languages", "programming_languages", on_delete: :cascade
add_foreign_key "analytics_language_trend_repository_languages", "projects", on_delete: :cascade
+ add_foreign_key "analytics_repository_file_commits", "analytics_repository_files", on_delete: :cascade
+ add_foreign_key "analytics_repository_file_commits", "projects", on_delete: :cascade
+ add_foreign_key "analytics_repository_file_edits", "analytics_repository_files", on_delete: :cascade
+ add_foreign_key "analytics_repository_file_edits", "projects", on_delete: :cascade
+ add_foreign_key "analytics_repository_files", "projects", on_delete: :cascade
add_foreign_key "application_settings", "namespaces", column: "custom_project_templates_group_id", on_delete: :nullify
add_foreign_key "application_settings", "projects", column: "file_template_project_id", name: "fk_ec757bd087", on_delete: :nullify
add_foreign_key "application_settings", "projects", column: "instance_administration_project_id", on_delete: :nullify
@@ -3809,6 +4025,7 @@ ActiveRecord::Schema.define(version: 2019_09_18_104222) do
add_foreign_key "approval_project_rules_users", "users", on_delete: :cascade
add_foreign_key "approvals", "merge_requests", name: "fk_310d714958", on_delete: :cascade
add_foreign_key "approver_groups", "namespaces", column: "group_id", on_delete: :cascade
+ add_foreign_key "aws_roles", "users", on_delete: :cascade
add_foreign_key "badges", "namespaces", column: "group_id", on_delete: :cascade
add_foreign_key "badges", "projects", on_delete: :cascade
add_foreign_key "board_assignees", "boards", on_delete: :cascade
@@ -3872,7 +4089,10 @@ ActiveRecord::Schema.define(version: 2019_09_18_104222) do
add_foreign_key "cluster_platforms_kubernetes", "clusters", on_delete: :cascade
add_foreign_key "cluster_projects", "clusters", on_delete: :cascade
add_foreign_key "cluster_projects", "projects", on_delete: :cascade
+ add_foreign_key "cluster_providers_aws", "clusters", on_delete: :cascade
+ add_foreign_key "cluster_providers_aws", "users", column: "created_by_user_id", on_delete: :nullify
add_foreign_key "cluster_providers_gcp", "clusters", on_delete: :cascade
+ add_foreign_key "clusters", "projects", column: "management_project_id", name: "fk_f05c5e5a42", on_delete: :nullify
add_foreign_key "clusters", "users", on_delete: :nullify
add_foreign_key "clusters_applications_cert_managers", "clusters", on_delete: :cascade
add_foreign_key "clusters_applications_helm", "clusters", on_delete: :cascade
@@ -3893,11 +4113,15 @@ ActiveRecord::Schema.define(version: 2019_09_18_104222) do
add_foreign_key "deploy_keys_projects", "projects", name: "fk_58a901ca7e", on_delete: :cascade
add_foreign_key "deployments", "clusters", name: "fk_289bba3222", on_delete: :nullify
add_foreign_key "deployments", "projects", name: "fk_b9a3851b82", on_delete: :cascade
+ add_foreign_key "description_versions", "epics", on_delete: :cascade
+ add_foreign_key "description_versions", "issues", on_delete: :cascade
+ add_foreign_key "description_versions", "merge_requests", on_delete: :cascade
add_foreign_key "design_management_designs", "issues", on_delete: :cascade
add_foreign_key "design_management_designs", "projects", on_delete: :cascade
add_foreign_key "design_management_designs_versions", "design_management_designs", column: "design_id", name: "fk_03c671965c", on_delete: :cascade
add_foreign_key "design_management_designs_versions", "design_management_versions", column: "version_id", name: "fk_f4d25ba00c", on_delete: :cascade
add_foreign_key "design_management_versions", "issues", on_delete: :cascade
+ add_foreign_key "design_management_versions", "users", name: "fk_ee16b939e5", on_delete: :nullify
add_foreign_key "draft_notes", "merge_requests", on_delete: :cascade
add_foreign_key "draft_notes", "users", column: "author_id", on_delete: :cascade
add_foreign_key "elasticsearch_indexed_namespaces", "namespaces", on_delete: :cascade
@@ -3915,6 +4139,7 @@ ActiveRecord::Schema.define(version: 2019_09_18_104222) do
add_foreign_key "events", "namespaces", column: "group_id", name: "fk_61fbf6ca48", on_delete: :cascade
add_foreign_key "events", "projects", on_delete: :cascade
add_foreign_key "events", "users", column: "author_id", name: "fk_edfd187b6f", on_delete: :cascade
+ add_foreign_key "evidences", "releases", on_delete: :cascade
add_foreign_key "external_pull_requests", "projects", on_delete: :cascade
add_foreign_key "fork_network_members", "fork_networks", on_delete: :cascade
add_foreign_key "fork_network_members", "projects", column: "forked_from_project_id", name: "fk_b01280dae4", on_delete: :nullify
@@ -3951,6 +4176,7 @@ ActiveRecord::Schema.define(version: 2019_09_18_104222) do
add_foreign_key "gpg_signatures", "gpg_key_subkeys", on_delete: :nullify
add_foreign_key "gpg_signatures", "gpg_keys", on_delete: :nullify
add_foreign_key "gpg_signatures", "projects", on_delete: :cascade
+ add_foreign_key "grafana_integrations", "projects", on_delete: :cascade
add_foreign_key "group_custom_attributes", "namespaces", column: "group_id", on_delete: :cascade
add_foreign_key "identities", "saml_providers", name: "fk_aade90f0fc", on_delete: :cascade
add_foreign_key "import_export_uploads", "projects", on_delete: :cascade
@@ -3973,6 +4199,10 @@ ActiveRecord::Schema.define(version: 2019_09_18_104222) do
add_foreign_key "issues", "users", column: "author_id", name: "fk_05f1e72feb", on_delete: :nullify
add_foreign_key "issues", "users", column: "closed_by_id", name: "fk_c63cbf6c25", on_delete: :nullify
add_foreign_key "issues", "users", column: "updated_by_id", name: "fk_ffed080f01", on_delete: :nullify
+ add_foreign_key "issues_prometheus_alert_events", "issues", on_delete: :cascade
+ add_foreign_key "issues_prometheus_alert_events", "prometheus_alert_events", on_delete: :cascade
+ add_foreign_key "issues_self_managed_prometheus_alert_events", "issues", on_delete: :cascade
+ add_foreign_key "issues_self_managed_prometheus_alert_events", "self_managed_prometheus_alert_events", on_delete: :cascade
add_foreign_key "jira_connect_subscriptions", "jira_connect_installations", on_delete: :cascade
add_foreign_key "jira_connect_subscriptions", "namespaces", on_delete: :cascade
add_foreign_key "jira_tracker_data", "services", on_delete: :cascade
@@ -4064,6 +4294,7 @@ ActiveRecord::Schema.define(version: 2019_09_18_104222) do
add_foreign_key "project_incident_management_settings", "projects", on_delete: :cascade
add_foreign_key "project_metrics_settings", "projects", on_delete: :cascade
add_foreign_key "project_mirror_data", "projects", name: "fk_d1aad367d7", on_delete: :cascade
+ add_foreign_key "project_pages_metadata", "projects", on_delete: :cascade
add_foreign_key "project_repositories", "projects", on_delete: :cascade
add_foreign_key "project_repositories", "shards", on_delete: :restrict
add_foreign_key "project_repository_states", "projects", on_delete: :cascade
@@ -4111,6 +4342,8 @@ ActiveRecord::Schema.define(version: 2019_09_18_104222) do
add_foreign_key "reviews", "users", column: "author_id", on_delete: :nullify
add_foreign_key "saml_providers", "namespaces", column: "group_id", on_delete: :cascade
add_foreign_key "scim_oauth_access_tokens", "namespaces", column: "group_id", on_delete: :cascade
+ add_foreign_key "self_managed_prometheus_alert_events", "environments", on_delete: :cascade
+ add_foreign_key "self_managed_prometheus_alert_events", "projects", on_delete: :cascade
add_foreign_key "services", "projects", name: "fk_71cce407f9", on_delete: :cascade
add_foreign_key "slack_integrations", "services", on_delete: :cascade
add_foreign_key "smartcard_identities", "users", on_delete: :cascade
@@ -4119,6 +4352,7 @@ ActiveRecord::Schema.define(version: 2019_09_18_104222) do
add_foreign_key "software_license_policies", "software_licenses", on_delete: :cascade
add_foreign_key "subscriptions", "projects", on_delete: :cascade
add_foreign_key "suggestions", "notes", on_delete: :cascade
+ add_foreign_key "system_note_metadata", "description_versions", name: "fk_fbd87415c9", on_delete: :nullify
add_foreign_key "system_note_metadata", "notes", name: "fk_d83a918cb1", on_delete: :cascade
add_foreign_key "term_agreements", "application_setting_terms", column: "term_id"
add_foreign_key "term_agreements", "users", on_delete: :cascade
@@ -4143,6 +4377,15 @@ ActiveRecord::Schema.define(version: 2019_09_18_104222) do
add_foreign_key "users_ops_dashboard_projects", "projects", on_delete: :cascade
add_foreign_key "users_ops_dashboard_projects", "users", on_delete: :cascade
add_foreign_key "users_star_projects", "projects", name: "fk_22cd27ddfc", on_delete: :cascade
+ add_foreign_key "vulnerabilities", "epics", name: "fk_1d37cddf91", on_delete: :nullify
+ add_foreign_key "vulnerabilities", "milestones", column: "due_date_sourcing_milestone_id", name: "fk_7c5bb22a22", on_delete: :nullify
+ add_foreign_key "vulnerabilities", "milestones", column: "start_date_sourcing_milestone_id", name: "fk_88b4d546ef", on_delete: :nullify
+ add_foreign_key "vulnerabilities", "milestones", name: "fk_131d289c65", on_delete: :nullify
+ add_foreign_key "vulnerabilities", "projects", name: "fk_efb96ab1e2", on_delete: :cascade
+ add_foreign_key "vulnerabilities", "users", column: "author_id", name: "fk_b1de915a15", on_delete: :nullify
+ add_foreign_key "vulnerabilities", "users", column: "closed_by_id", name: "fk_cf5c60acbf", on_delete: :nullify
+ add_foreign_key "vulnerabilities", "users", column: "last_edited_by_id", name: "fk_1302949740", on_delete: :nullify
+ add_foreign_key "vulnerabilities", "users", column: "updated_by_id", name: "fk_7ac31eacb9", on_delete: :nullify
add_foreign_key "vulnerability_feedback", "ci_pipelines", column: "pipeline_id", on_delete: :nullify
add_foreign_key "vulnerability_feedback", "issues", on_delete: :nullify
add_foreign_key "vulnerability_feedback", "merge_requests", name: "fk_563ff1912e", on_delete: :nullify
@@ -4155,6 +4398,7 @@ ActiveRecord::Schema.define(version: 2019_09_18_104222) do
add_foreign_key "vulnerability_occurrence_pipelines", "ci_pipelines", column: "pipeline_id", on_delete: :cascade
add_foreign_key "vulnerability_occurrence_pipelines", "vulnerability_occurrences", column: "occurrence_id", on_delete: :cascade
add_foreign_key "vulnerability_occurrences", "projects", on_delete: :cascade
+ add_foreign_key "vulnerability_occurrences", "vulnerabilities", name: "fk_97ffe77653", on_delete: :nullify
add_foreign_key "vulnerability_occurrences", "vulnerability_identifiers", column: "primary_identifier_id", on_delete: :cascade
add_foreign_key "vulnerability_occurrences", "vulnerability_scanners", column: "scanner_id", on_delete: :cascade
add_foreign_key "vulnerability_scanners", "projects", on_delete: :cascade