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>2019-09-13 16:26:31 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-09-13 16:26:31 +0300
commitb7dfe2ae4054aa40e15182fd3c6cb7dd39f131db (patch)
tree5ab080ca9cadeb6cd9578bf301e4e9e8810bed9e /db
parent25cb337cf12438169f1b14bc5dace8a06a7356e3 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20190830140240_add_duplicated_to_to_issue.rb27
-rw-r--r--db/migrate/20190906104555_create_alerts_service_data.rb15
-rw-r--r--db/migrate/20190910103144_replace_events_index_on_group_id_with_partial_index.rb19
-rw-r--r--db/migrate/20190910114843_exclude_nulls_from_index_on_namespaces_type.rb20
-rw-r--r--db/schema.rb253
5 files changed, 214 insertions, 120 deletions
diff --git a/db/migrate/20190830140240_add_duplicated_to_to_issue.rb b/db/migrate/20190830140240_add_duplicated_to_to_issue.rb
new file mode 100644
index 00000000000..b38e4302a0b
--- /dev/null
+++ b/db/migrate/20190830140240_add_duplicated_to_to_issue.rb
@@ -0,0 +1,27 @@
+# frozen_string_literal: true
+
+class AddDuplicatedToToIssue < ActiveRecord::Migration[5.2]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ disable_ddl_transaction!
+
+ def up
+ add_column :issues, :duplicated_to_id, :integer unless duplicated_to_id_exists?
+ add_concurrent_foreign_key :issues, :issues, column: :duplicated_to_id, on_delete: :nullify
+ add_concurrent_index :issues, :duplicated_to_id, where: 'duplicated_to_id IS NOT NULL'
+ end
+
+ def down
+ remove_foreign_key_without_error(:issues, column: :duplicated_to_id)
+ remove_concurrent_index(:issues, :duplicated_to_id)
+ remove_column(:issues, :duplicated_to_id) if duplicated_to_id_exists?
+ end
+
+ private
+
+ def duplicated_to_id_exists?
+ column_exists?(:issues, :duplicated_to_id)
+ end
+end
diff --git a/db/migrate/20190906104555_create_alerts_service_data.rb b/db/migrate/20190906104555_create_alerts_service_data.rb
new file mode 100644
index 00000000000..8ce447a67d1
--- /dev/null
+++ b/db/migrate/20190906104555_create_alerts_service_data.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class CreateAlertsServiceData < ActiveRecord::Migration[5.2]
+ DOWNTIME = false
+
+ def change
+ create_table :alerts_service_data do |t|
+ t.references :service, type: :integer, index: true, null: false,
+ foreign_key: { on_delete: :cascade }
+ t.timestamps_with_timezone
+ t.string :encrypted_token, limit: 255
+ t.string :encrypted_token_iv, limit: 255
+ end
+ end
+end
diff --git a/db/migrate/20190910103144_replace_events_index_on_group_id_with_partial_index.rb b/db/migrate/20190910103144_replace_events_index_on_group_id_with_partial_index.rb
new file mode 100644
index 00000000000..40a7454fd20
--- /dev/null
+++ b/db/migrate/20190910103144_replace_events_index_on_group_id_with_partial_index.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+class ReplaceEventsIndexOnGroupIdWithPartialIndex < ActiveRecord::Migration[5.2]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_index(:events, :group_id, where: 'group_id IS NOT NULL', name: 'index_events_on_group_id_partial')
+ remove_concurrent_index_by_name(:events, 'index_events_on_group_id')
+ end
+
+ def down
+ add_concurrent_index(:events, :group_id, name: 'index_events_on_group_id')
+ remove_concurrent_index_by_name(:events, 'index_events_on_group_id_partial')
+ end
+end
diff --git a/db/migrate/20190910114843_exclude_nulls_from_index_on_namespaces_type.rb b/db/migrate/20190910114843_exclude_nulls_from_index_on_namespaces_type.rb
new file mode 100644
index 00000000000..8237c48b16d
--- /dev/null
+++ b/db/migrate/20190910114843_exclude_nulls_from_index_on_namespaces_type.rb
@@ -0,0 +1,20 @@
+# frozen_string_literal: true
+
+class ExcludeNullsFromIndexOnNamespacesType < ActiveRecord::Migration[5.1]
+ include Gitlab::Database::MigrationHelpers
+
+ # Set this constant to true if this migration requires downtime.
+ DOWNTIME = false
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_index(:namespaces, :type, where: 'type is not null', name: 'index_namespaces_on_type_partial')
+ remove_concurrent_index_by_name(:namespaces, 'index_namespaces_on_type')
+ end
+
+ def down
+ add_concurrent_index(:namespaces, :type, name: 'index_namespaces_on_type')
+ remove_concurrent_index_by_name(:namespaces, 'index_namespaces_on_type_partial')
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 39faf1e651e..95069f711fb 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -26,6 +26,15 @@ ActiveRecord::Schema.define(version: 2019_09_12_061145) do
t.integer "cached_markdown_version"
end
+ create_table "alerts_service_data", force: :cascade do |t|
+ t.integer "service_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
+ t.string "encrypted_token_iv", limit: 255
+ t.index ["service_id"], name: "index_alerts_service_data_on_service_id"
+ end
+
create_table "allowed_email_domains", force: :cascade do |t|
t.datetime_with_timezone "created_at", null: false
t.datetime_with_timezone "updated_at", null: false
@@ -75,8 +84,9 @@ ActiveRecord::Schema.define(version: 2019_09_12_061145) do
create_table "appearances", id: :serial, force: :cascade do |t|
t.string "title", null: false
t.text "description", null: false
- t.string "header_logo"
t.string "logo"
+ t.integer "updated_by"
+ t.string "header_logo"
t.datetime_with_timezone "created_at", null: false
t.datetime_with_timezone "updated_at", null: false
t.text "description_html"
@@ -91,7 +101,6 @@ ActiveRecord::Schema.define(version: 2019_09_12_061145) do
t.text "message_font_color"
t.string "favicon"
t.boolean "email_header_and_footer_enabled", default: false, null: false
- t.integer "updated_by"
end
create_table "application_setting_terms", id: :serial, force: :cascade do |t|
@@ -241,6 +250,7 @@ ActiveRecord::Schema.define(version: 2019_09_12_061145) do
t.boolean "pseudonymizer_enabled", default: false, null: false
t.boolean "hide_third_party_offers", default: false, null: false
t.boolean "snowplow_enabled", default: false, null: false
+ t.string "snowplow_collector_hostname"
t.string "snowplow_site_id"
t.string "snowplow_cookie_domain"
t.boolean "instance_statistics_visibility_private", default: false, null: false
@@ -278,7 +288,6 @@ ActiveRecord::Schema.define(version: 2019_09_12_061145) do
t.boolean "allow_local_requests_from_web_hooks_and_services", default: false, null: false
t.boolean "allow_local_requests_from_system_hooks", default: true, null: false
t.bigint "instance_administration_project_id"
- t.string "snowplow_collector_hostname"
t.boolean "asset_proxy_enabled", default: false, null: false
t.string "asset_proxy_url"
t.text "asset_proxy_whitelist"
@@ -533,8 +542,8 @@ ActiveRecord::Schema.define(version: 2019_09_12_061145) do
create_table "ci_build_trace_sections", id: :serial, force: :cascade do |t|
t.integer "project_id", null: false
- t.datetime_with_timezone "date_start", null: false
- t.datetime_with_timezone "date_end", null: false
+ t.datetime "date_start", null: false
+ t.datetime "date_end", null: false
t.bigint "byte_start", null: false
t.bigint "byte_end", null: false
t.integer "build_id", null: false
@@ -656,12 +665,12 @@ ActiveRecord::Schema.define(version: 2019_09_12_061145) do
t.integer "project_id", null: false
t.integer "job_id", null: false
t.integer "file_type", null: false
- t.integer "file_store"
t.bigint "size"
t.datetime_with_timezone "created_at", null: false
t.datetime_with_timezone "updated_at", null: false
t.datetime_with_timezone "expire_at"
t.string "file"
+ t.integer "file_store"
t.binary "file_sha256"
t.integer "file_format", limit: 2
t.integer "file_location", limit: 2
@@ -690,7 +699,7 @@ ActiveRecord::Schema.define(version: 2019_09_12_061145) do
t.index ["pipeline_id"], name: "index_ci_pipeline_chat_data_on_pipeline_id", unique: true
end
- create_table "ci_pipeline_schedule_variables", force: :cascade do |t|
+ create_table "ci_pipeline_schedule_variables", id: :serial, force: :cascade do |t|
t.string "key", null: false
t.text "value"
t.text "encrypted_value"
@@ -889,8 +898,8 @@ ActiveRecord::Schema.define(version: 2019_09_12_061145) do
create_table "cluster_platforms_kubernetes", id: :serial, force: :cascade do |t|
t.integer "cluster_id", null: false
- t.datetime_with_timezone "created_at", null: false
- t.datetime_with_timezone "updated_at", null: false
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
t.text "api_url"
t.text "ca_cert"
t.string "namespace"
@@ -906,8 +915,8 @@ ActiveRecord::Schema.define(version: 2019_09_12_061145) do
create_table "cluster_projects", id: :serial, force: :cascade do |t|
t.integer "project_id", null: false
t.integer "cluster_id", null: false
- t.datetime_with_timezone "created_at", null: false
- t.datetime_with_timezone "updated_at", null: false
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
t.index ["cluster_id"], name: "index_cluster_projects_on_cluster_id"
t.index ["project_id"], name: "index_cluster_projects_on_project_id"
end
@@ -916,8 +925,8 @@ ActiveRecord::Schema.define(version: 2019_09_12_061145) do
t.integer "cluster_id", null: false
t.integer "status"
t.integer "num_nodes", null: false
- t.datetime_with_timezone "created_at", null: false
- t.datetime_with_timezone "updated_at", null: false
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
t.text "status_reason"
t.string "gcp_project_id", null: false
t.string "zone", null: false
@@ -934,8 +943,8 @@ ActiveRecord::Schema.define(version: 2019_09_12_061145) do
t.integer "user_id"
t.integer "provider_type"
t.integer "platform_type"
- t.datetime_with_timezone "created_at", null: false
- t.datetime_with_timezone "updated_at", null: false
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
t.boolean "enabled", default: true
t.string "name", null: false
t.string "environment_scope", default: "*", null: false
@@ -960,8 +969,8 @@ ActiveRecord::Schema.define(version: 2019_09_12_061145) do
create_table "clusters_applications_helm", id: :serial, force: :cascade do |t|
t.integer "cluster_id", null: false
- t.datetime_with_timezone "created_at", null: false
- t.datetime_with_timezone "updated_at", null: false
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
t.integer "status", null: false
t.string "version", null: false
t.text "status_reason"
@@ -973,8 +982,8 @@ ActiveRecord::Schema.define(version: 2019_09_12_061145) do
create_table "clusters_applications_ingress", id: :serial, force: :cascade do |t|
t.integer "cluster_id", null: false
- t.datetime_with_timezone "created_at", null: false
- t.datetime_with_timezone "updated_at", 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
@@ -1018,9 +1027,9 @@ ActiveRecord::Schema.define(version: 2019_09_12_061145) do
t.text "status_reason"
t.datetime_with_timezone "created_at", null: false
t.datetime_with_timezone "updated_at", null: false
+ t.datetime_with_timezone "last_update_started_at"
t.string "encrypted_alert_manager_token"
t.string "encrypted_alert_manager_token_iv"
- t.datetime_with_timezone "last_update_started_at"
t.index ["cluster_id"], name: "index_clusters_applications_prometheus_on_cluster_id", unique: true
end
@@ -1101,21 +1110,21 @@ ActiveRecord::Schema.define(version: 2019_09_12_061145) do
end
create_table "dependency_proxy_blobs", id: :serial, force: :cascade do |t|
- t.datetime_with_timezone "created_at", null: false
- t.text "file", null: false
- t.string "file_name", null: false
- t.integer "file_store"
t.integer "group_id", null: false
- t.bigint "size"
+ t.datetime_with_timezone "created_at", null: false
t.datetime_with_timezone "updated_at", null: false
+ t.bigint "size"
+ t.integer "file_store"
+ t.string "file_name", null: false
+ t.text "file", null: false
t.index ["group_id", "file_name"], name: "index_dependency_proxy_blobs_on_group_id_and_file_name"
end
create_table "dependency_proxy_group_settings", id: :serial, force: :cascade do |t|
- t.datetime_with_timezone "created_at", null: false
- t.boolean "enabled", default: false, null: false
t.integer "group_id", null: false
+ t.datetime_with_timezone "created_at", null: false
t.datetime_with_timezone "updated_at", null: false
+ t.boolean "enabled", default: false, null: false
t.index ["group_id"], name: "index_dependency_proxy_group_settings_on_group_id"
end
@@ -1231,8 +1240,8 @@ ActiveRecord::Schema.define(version: 2019_09_12_061145) do
t.datetime "created_at"
t.datetime "updated_at"
t.string "confirmation_token"
- t.datetime_with_timezone "confirmed_at"
- t.datetime_with_timezone "confirmation_sent_at"
+ t.datetime "confirmed_at"
+ t.datetime "confirmation_sent_at"
t.index ["confirmation_token"], name: "index_emails_on_confirmation_token", unique: true
t.index ["email"], name: "index_emails_on_email", unique: true
t.index ["user_id"], name: "index_emails_on_user_id"
@@ -1321,7 +1330,7 @@ ActiveRecord::Schema.define(version: 2019_09_12_061145) do
t.index ["action"], name: "index_events_on_action"
t.index ["author_id", "project_id"], name: "index_events_on_author_id_and_project_id"
t.index ["created_at", "author_id"], name: "analytics_index_events_on_created_at_and_author_id"
- t.index ["group_id"], name: "index_events_on_group_id"
+ t.index ["group_id"], name: "index_events_on_group_id_partial", where: "(group_id IS NOT NULL)"
t.index ["project_id", "created_at"], name: "index_events_on_project_id_and_created_at"
t.index ["project_id", "id"], name: "index_events_on_project_id_and_id"
t.index ["target_type", "target_id"], name: "index_events_on_target_type_and_target_id"
@@ -1679,8 +1688,8 @@ ActiveRecord::Schema.define(version: 2019_09_12_061145) do
t.integer "user_id"
t.datetime "created_at"
t.datetime "updated_at"
- t.integer "saml_provider_id"
t.string "secondary_extern_uid"
+ t.integer "saml_provider_id"
t.index "lower((extern_uid)::text), provider", name: "index_on_identities_lower_extern_uid_and_provider"
t.index ["saml_provider_id"], name: "index_identities_on_saml_provider_id", where: "(saml_provider_id IS NOT NULL)"
t.index ["user_id"], name: "index_identities_on_user_id"
@@ -1782,6 +1791,7 @@ ActiveRecord::Schema.define(version: 2019_09_12_061145) do
t.string "state"
t.integer "iid"
t.integer "updated_by_id"
+ t.integer "weight"
t.boolean "confidential", default: false, null: false
t.date "due_date"
t.integer "moved_to_id"
@@ -1790,6 +1800,7 @@ ActiveRecord::Schema.define(version: 2019_09_12_061145) do
t.text "description_html"
t.integer "time_estimate"
t.integer "relative_position"
+ t.string "service_desk_reply_to"
t.integer "cached_markdown_version"
t.datetime "last_edited_at"
t.integer "last_edited_by_id"
@@ -1797,12 +1808,12 @@ ActiveRecord::Schema.define(version: 2019_09_12_061145) do
t.datetime_with_timezone "closed_at"
t.integer "closed_by_id"
t.integer "state_id", limit: 2
- t.string "service_desk_reply_to"
- t.integer "weight"
+ 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"
t.index ["confidential"], name: "index_issues_on_confidential"
t.index ["description"], name: "index_issues_on_description_trigram", opclass: :gin_trgm_ops, using: :gin
+ t.index ["duplicated_to_id"], name: "index_issues_on_duplicated_to_id", where: "(duplicated_to_id IS NOT NULL)"
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"
@@ -1826,9 +1837,9 @@ ActiveRecord::Schema.define(version: 2019_09_12_061145) do
end
create_table "jira_connect_subscriptions", force: :cascade do |t|
- t.datetime_with_timezone "created_at", null: false
t.bigint "jira_connect_installation_id", null: false
t.integer "namespace_id", null: false
+ t.datetime_with_timezone "created_at", null: false
t.datetime_with_timezone "updated_at", null: false
t.index ["jira_connect_installation_id", "namespace_id"], name: "idx_jira_connect_subscriptions_on_installation_id_namespace_id", unique: true
t.index ["jira_connect_installation_id"], name: "idx_jira_connect_subscriptions_on_installation_id"
@@ -1970,8 +1981,8 @@ ActiveRecord::Schema.define(version: 2019_09_12_061145) do
t.integer "position"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
- t.integer "milestone_id"
t.integer "user_id"
+ t.integer "milestone_id"
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"
@@ -2023,8 +2034,8 @@ ActiveRecord::Schema.define(version: 2019_09_12_061145) do
end
create_table "merge_request_diff_commits", id: false, force: :cascade do |t|
- t.datetime_with_timezone "authored_date"
- t.datetime_with_timezone "committed_date"
+ t.datetime "authored_date"
+ t.datetime "committed_date"
t.integer "merge_request_diff_id", null: false
t.integer "relative_order", null: false
t.binary "sha", null: false
@@ -2120,11 +2131,14 @@ ActiveRecord::Schema.define(version: 2019_09_12_061145) do
t.boolean "merge_when_pipeline_succeeds", default: false, null: false
t.integer "merge_user_id"
t.string "merge_commit_sha"
+ t.integer "approvals_before_merge"
+ t.string "rebase_commit_sha"
t.string "in_progress_merge_commit_sha"
t.integer "lock_version"
t.text "title_html"
t.text "description_html"
t.integer "time_estimate"
+ t.boolean "squash", default: false, null: false
t.integer "cached_markdown_version"
t.datetime "last_edited_at"
t.integer "last_edited_by_id"
@@ -2132,11 +2146,8 @@ ActiveRecord::Schema.define(version: 2019_09_12_061145) do
t.string "merge_jid"
t.boolean "discussion_locked"
t.integer "latest_merge_request_diff_id"
- t.string "rebase_commit_sha"
- t.boolean "squash", default: false, null: false
t.boolean "allow_maintainer_to_push"
t.integer "state_id", limit: 2
- t.integer "approvals_before_merge"
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"
@@ -2243,34 +2254,34 @@ ActiveRecord::Schema.define(version: 2019_09_12_061145) do
t.string "type"
t.string "description", default: "", null: false
t.string "avatar"
+ 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.string "ldap_sync_status", default: "ready", null: false
+ t.string "ldap_sync_error"
+ t.datetime "ldap_sync_last_update_at"
+ t.datetime "ldap_sync_last_successful_update_at"
+ t.datetime "ldap_sync_last_sync_at"
t.text "description_html"
t.boolean "lfs_enabled"
t.integer "parent_id"
+ t.integer "shared_runners_minutes_limit"
+ t.bigint "repository_size_limit"
t.boolean "require_two_factor_authentication", default: false, null: false
t.integer "two_factor_grace_period", default: 48, null: false
t.integer "cached_markdown_version"
- t.string "runners_token"
- t.string "runners_token_encrypted"
+ t.integer "plan_id"
t.integer "project_creation_level"
- t.boolean "auto_devops_enabled"
- t.datetime_with_timezone "last_ci_minutes_notification_at"
- t.integer "custom_project_templates_group_id"
+ t.string "runners_token"
+ t.datetime_with_timezone "trial_ends_on"
t.integer "file_template_project_id"
- t.string "ldap_sync_error"
- t.datetime "ldap_sync_last_successful_update_at"
- t.datetime "ldap_sync_last_sync_at"
- t.datetime "ldap_sync_last_update_at"
- t.integer "plan_id"
- t.bigint "repository_size_limit"
t.string "saml_discovery_token"
- t.integer "shared_runners_minutes_limit"
- t.datetime_with_timezone "trial_ends_on"
+ t.string "runners_token_encrypted"
+ t.integer "custom_project_templates_group_id"
+ t.boolean "auto_devops_enabled"
t.integer "extra_shared_runners_minutes_limit"
- t.string "ldap_sync_status", default: "ready", null: false
- t.boolean "membership_lock", default: false
+ t.datetime_with_timezone "last_ci_minutes_notification_at"
t.integer "last_ci_minutes_usage_notification_level"
t.integer "subgroup_creation_level", default: 1
t.boolean "emails_disabled"
@@ -2291,7 +2302,7 @@ ActiveRecord::Schema.define(version: 2019_09_12_061145) do
t.index ["runners_token_encrypted"], name: "index_namespaces_on_runners_token_encrypted", unique: true
t.index ["shared_runners_minutes_limit", "extra_shared_runners_minutes_limit"], name: "index_namespaces_on_shared_and_extra_runners_minutes_limit"
t.index ["trial_ends_on"], name: "index_namespaces_on_trial_ends_on", where: "(trial_ends_on IS NOT NULL)"
- t.index ["type"], name: "index_namespaces_on_type"
+ t.index ["type"], name: "index_namespaces_on_type_partial", where: "(type IS NOT NULL)"
end
create_table "note_diff_files", id: :serial, force: :cascade do |t|
@@ -2365,8 +2376,8 @@ ActiveRecord::Schema.define(version: 2019_09_12_061145) do
t.boolean "success_pipeline"
t.boolean "push_to_merge_request"
t.boolean "issue_due"
- t.string "notification_email"
t.boolean "new_epic"
+ t.string "notification_email"
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"
@@ -2702,15 +2713,15 @@ ActiveRecord::Schema.define(version: 2019_09_12_061145) do
create_table "project_mirror_data", id: :serial, force: :cascade do |t|
t.integer "project_id", null: false
+ t.integer "retry_count", default: 0, null: false
+ t.datetime "last_update_started_at"
+ t.datetime "last_update_scheduled_at"
+ t.datetime "next_execution_timestamp"
t.string "status"
t.string "jid"
t.text "last_error"
- t.datetime_with_timezone "last_successful_update_at"
t.datetime_with_timezone "last_update_at"
- t.datetime "last_update_scheduled_at"
- t.datetime "last_update_started_at"
- t.datetime "next_execution_timestamp"
- t.integer "retry_count", default: 0, null: false
+ t.datetime_with_timezone "last_successful_update_at"
t.index ["jid"], name: "index_project_mirror_data_on_jid"
t.index ["last_successful_update_at"], name: "index_project_mirror_data_on_last_successful_update_at"
t.index ["last_update_at", "retry_count"], name: "index_project_mirror_data_on_last_update_at_and_retry_count"
@@ -2756,10 +2767,10 @@ ActiveRecord::Schema.define(version: 2019_09_12_061145) do
t.bigint "repository_size", default: 0, null: false
t.bigint "lfs_objects_size", default: 0, null: false
t.bigint "build_artifacts_size", default: 0, null: false
- t.bigint "packages_size", default: 0, null: false
- t.bigint "wiki_size"
t.bigint "shared_runners_seconds", default: 0, null: false
t.datetime "shared_runners_seconds_last_reset"
+ t.bigint "packages_size", default: 0, null: false
+ t.bigint "wiki_size"
t.index ["namespace_id"], name: "index_project_statistics_on_namespace_id"
t.index ["project_id"], name: "index_project_statistics_on_project_id", unique: true
end
@@ -2785,14 +2796,25 @@ ActiveRecord::Schema.define(version: 2019_09_12_061145) do
t.integer "visibility_level", default: 0, null: false
t.boolean "archived", default: false, null: false
t.string "avatar"
+ t.text "merge_requests_template"
t.integer "star_count", default: 0, null: false
+ t.boolean "merge_requests_rebase_enabled", default: false
t.string "import_type"
t.string "import_source"
+ t.integer "approvals_before_merge", default: 0, null: false
+ t.boolean "reset_approvals_on_push", default: true
+ t.boolean "merge_requests_ff_only_enabled", default: false
+ t.text "issues_template"
+ t.boolean "mirror", default: false, null: false
+ t.datetime "mirror_last_update_at"
+ t.datetime "mirror_last_successful_update_at"
+ t.integer "mirror_user_id"
t.boolean "shared_runners_enabled", default: true, null: false
t.string "runners_token"
t.string "build_coverage_regex"
t.boolean "build_allow_git_fetch", default: true, null: false
t.integer "build_timeout", default: 3600, null: false
+ t.boolean "mirror_trigger_builds", default: false, null: false
t.boolean "pending_delete", default: false
t.boolean "public_builds", default: true, null: false
t.boolean "last_repository_check_failed"
@@ -2801,51 +2823,40 @@ ActiveRecord::Schema.define(version: 2019_09_12_061145) do
t.boolean "only_allow_merge_if_pipeline_succeeds", default: false, null: false
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 "has_external_wiki"
t.string "ci_config_path"
t.boolean "lfs_enabled"
t.text "description_html"
t.boolean "only_allow_merge_if_all_discussions_are_resolved"
+ t.bigint "repository_size_limit"
t.boolean "printing_merge_request_link_enabled", default: true, null: false
t.integer "auto_cancel_pending_pipelines", default: 1, null: false
+ t.boolean "service_desk_enabled", default: true
t.integer "cached_markdown_version"
t.text "delete_error"
t.datetime "last_repository_updated_at"
+ t.boolean "disable_overriding_approvers_per_merge_request"
t.integer "storage_version", limit: 2
t.boolean "resolve_outdated_diff_discussions"
- t.boolean "repository_read_only"
- t.boolean "merge_requests_ff_only_enabled", default: false
- t.boolean "merge_requests_rebase_enabled", default: false
+ t.boolean "remote_mirror_available_overridden"
+ t.boolean "only_mirror_protected_branches"
+ t.boolean "pull_mirror_available_overridden"
t.integer "jobs_cache_index"
+ t.string "external_authorization_classification_label"
+ t.boolean "mirror_overwrites_diverged_branches"
t.boolean "pages_https_only", default: true
- t.boolean "remote_mirror_available_overridden"
+ t.string "external_webhook_token"
+ t.boolean "packages_enabled"
+ t.boolean "merge_requests_author_approval"
t.bigint "pool_repository_id"
t.string "runners_token_encrypted"
t.string "bfg_object_map"
+ t.boolean "merge_requests_require_code_owner_approval"
t.boolean "detected_repository_languages"
- t.string "external_authorization_classification_label"
- t.boolean "disable_overriding_approvers_per_merge_request"
- t.string "external_webhook_token"
- t.text "issues_template"
- t.boolean "merge_requests_author_approval"
t.boolean "merge_requests_disable_committers_approval"
- t.boolean "merge_requests_require_code_owner_approval"
- t.text "merge_requests_template"
- t.datetime "mirror_last_successful_update_at"
- t.datetime "mirror_last_update_at"
- t.boolean "mirror_overwrites_diverged_branches"
- t.integer "mirror_user_id"
- t.boolean "only_mirror_protected_branches"
- t.boolean "packages_enabled"
- t.boolean "pull_mirror_available_overridden"
- t.bigint "repository_size_limit"
t.boolean "require_password_to_approve"
- t.boolean "mirror", default: false, null: false
- t.boolean "mirror_trigger_builds", default: false, null: false
- t.boolean "reset_approvals_on_push", default: true
- t.boolean "service_desk_enabled", default: true
- t.integer "approvals_before_merge", default: 0, null: false
t.boolean "emails_disabled"
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"
@@ -2921,8 +2932,8 @@ ActiveRecord::Schema.define(version: 2019_09_12_061145) do
t.integer "access_level", default: 40
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
- t.integer "group_id"
t.integer "user_id"
+ t.integer "group_id"
t.index ["group_id"], name: "index_protected_branch_merge_access_levels_on_group_id"
t.index ["protected_branch_id"], name: "index_protected_branch_merge_access"
t.index ["user_id"], name: "index_protected_branch_merge_access_levels_on_user_id"
@@ -2933,8 +2944,8 @@ ActiveRecord::Schema.define(version: 2019_09_12_061145) do
t.integer "access_level", default: 40
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
- t.integer "group_id"
t.integer "user_id"
+ t.integer "group_id"
t.index ["group_id"], name: "index_protected_branch_push_access_levels_on_group_id"
t.index ["protected_branch_id"], name: "index_protected_branch_push_access"
t.index ["user_id"], name: "index_protected_branch_push_access_levels_on_user_id"
@@ -3080,15 +3091,15 @@ ActiveRecord::Schema.define(version: 2019_09_12_061145) do
t.string "update_status"
t.datetime "last_update_at"
t.datetime "last_successful_update_at"
- t.datetime "last_update_started_at"
t.string "last_error"
- t.boolean "only_protected_branches", default: false, null: false
- t.string "remote_name"
t.text "encrypted_credentials"
t.string "encrypted_credentials_iv"
t.string "encrypted_credentials_salt"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
+ t.datetime "last_update_started_at"
+ t.boolean "only_protected_branches", default: false, null: false
+ t.string "remote_name"
t.boolean "error_notification_sent"
t.index ["last_successful_update_at"], name: "index_remote_mirrors_on_last_successful_update_at"
t.index ["project_id"], name: "index_remote_mirrors_on_project_id"
@@ -3105,13 +3116,13 @@ ActiveRecord::Schema.define(version: 2019_09_12_061145) do
t.integer "action", null: false
t.integer "issue_id"
t.integer "merge_request_id"
+ t.integer "epic_id"
t.integer "label_id"
t.integer "user_id"
t.datetime_with_timezone "created_at", null: false
t.integer "cached_markdown_version"
t.text "reference"
t.text "reference_html"
- t.integer "epic_id"
t.index ["epic_id"], name: "index_resource_label_events_on_epic_id"
t.index ["issue_id"], name: "index_resource_label_events_on_issue_id"
t.index ["label_id"], name: "index_resource_label_events_on_label_id"
@@ -3350,7 +3361,7 @@ ActiveRecord::Schema.define(version: 2019_09_12_061145) do
t.datetime "updated_at", null: false
t.integer "issue_id"
t.integer "merge_request_id"
- t.datetime_with_timezone "spent_at"
+ t.datetime "spent_at"
t.index ["issue_id"], name: "index_timelogs_on_issue_id"
t.index ["merge_request_id"], name: "index_timelogs_on_merge_request_id"
t.index ["user_id"], name: "index_timelogs_on_user_id"
@@ -3406,9 +3417,9 @@ ActiveRecord::Schema.define(version: 2019_09_12_061145) do
t.string "model_type"
t.string "uploader", null: false
t.datetime "created_at", null: false
+ t.integer "store"
t.string "mount_point"
t.string "secret"
- t.integer "store"
t.index ["checksum"], name: "index_uploads_on_checksum"
t.index ["model_id", "model_type"], name: "index_uploads_on_model_id_and_model_type"
t.index ["store"], name: "index_uploads_on_store"
@@ -3434,8 +3445,8 @@ ActiveRecord::Schema.define(version: 2019_09_12_061145) do
end
create_table "user_custom_attributes", id: :serial, force: :cascade do |t|
- t.datetime_with_timezone "created_at", null: false
- t.datetime_with_timezone "updated_at", null: false
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
t.integer "user_id", null: false
t.string "key", null: false
t.string "value", null: false
@@ -3456,16 +3467,16 @@ ActiveRecord::Schema.define(version: 2019_09_12_061145) do
t.integer "merge_request_notes_filter", limit: 2, default: 0, null: false
t.datetime_with_timezone "created_at", null: false
t.datetime_with_timezone "updated_at", null: false
- t.integer "first_day_of_week"
+ t.string "epics_sort"
+ t.integer "roadmap_epics_state"
+ t.integer "epic_notes_filter", limit: 2, default: 0, null: false
t.string "issues_sort"
t.string "merge_requests_sort"
+ t.string "roadmaps_sort"
+ t.integer "first_day_of_week"
t.string "timezone"
t.boolean "time_display_relative"
t.boolean "time_format_in_24h"
- t.integer "epic_notes_filter", limit: 2, default: 0, null: false
- t.string "epics_sort"
- t.integer "roadmap_epics_state"
- t.string "roadmaps_sort"
t.string "projects_sort", limit: 64
t.index ["user_id"], name: "index_user_preferences_on_user_id", unique: true
end
@@ -3524,6 +3535,7 @@ ActiveRecord::Schema.define(version: 2019_09_12_061145) do
t.string "unconfirmed_email"
t.boolean "hide_no_ssh_key", default: false
t.string "website_url", default: "", null: false
+ t.datetime "admin_email_unsubscribed_at"
t.string "notification_email"
t.boolean "hide_no_password", default: false
t.boolean "password_automatically_set", default: false
@@ -3539,33 +3551,32 @@ ActiveRecord::Schema.define(version: 2019_09_12_061145) do
t.integer "consumed_timestep"
t.integer "layout", default: 0
t.boolean "hide_project_limit", default: false
+ t.text "note"
t.string "unlock_token"
t.datetime "otp_grace_period_started_at"
t.boolean "external", default: false
t.string "incoming_email_token"
t.string "organization"
+ t.boolean "auditor", default: false, null: false
t.boolean "require_two_factor_authentication_from_group", default: false, null: false
t.integer "two_factor_grace_period", default: 48, null: false
t.boolean "ghost"
t.date "last_activity_on"
t.boolean "notified_of_own_activity"
t.string "preferred_language"
+ t.boolean "email_opted_in"
+ t.string "email_opted_in_ip"
+ t.integer "email_opted_in_source_id"
+ t.datetime "email_opted_in_at"
t.integer "theme_id", limit: 2
t.integer "accepted_term_id"
t.string "feed_token"
t.boolean "private_profile", default: false, null: false
+ t.integer "roadmap_layout", limit: 2
t.boolean "include_private_contributions"
t.string "commit_email"
- t.boolean "auditor", default: false, null: false
- t.datetime "admin_email_unsubscribed_at"
- t.boolean "email_opted_in"
- t.datetime "email_opted_in_at"
- t.string "email_opted_in_ip"
- t.integer "email_opted_in_source_id"
t.integer "group_view"
t.integer "managing_group_id"
- t.text "note"
- t.integer "roadmap_layout", limit: 2
t.integer "bot_type", limit: 2
t.string "first_name", limit: 255
t.string "last_name", limit: 255
@@ -3722,6 +3733,7 @@ ActiveRecord::Schema.define(version: 2019_09_12_061145) do
t.boolean "issues_events", default: false, null: false
t.boolean "merge_requests_events", default: false, null: false
t.boolean "tag_push_events", default: false
+ t.integer "group_id"
t.boolean "note_events", default: false, null: false
t.boolean "enable_ssl_verification", default: true
t.boolean "wiki_page_events", default: false, null: false
@@ -3735,11 +3747,11 @@ ActiveRecord::Schema.define(version: 2019_09_12_061145) do
t.string "encrypted_token_iv"
t.string "encrypted_url"
t.string "encrypted_url_iv"
- t.integer "group_id"
t.index ["project_id"], name: "index_web_hooks_on_project_id"
t.index ["type"], name: "index_web_hooks_on_type"
end
+ add_foreign_key "alerts_service_data", "services", on_delete: :cascade
add_foreign_key "allowed_email_domains", "namespaces", column: "group_id", on_delete: :cascade
add_foreign_key "analytics_cycle_analytics_group_stages", "labels", column: "end_event_label_id", on_delete: :cascade
add_foreign_key "analytics_cycle_analytics_group_stages", "labels", column: "start_event_label_id", on_delete: :cascade
@@ -3779,7 +3791,7 @@ ActiveRecord::Schema.define(version: 2019_09_12_061145) do
add_foreign_key "board_project_recent_visits", "boards", on_delete: :cascade
add_foreign_key "board_project_recent_visits", "projects", on_delete: :cascade
add_foreign_key "board_project_recent_visits", "users", on_delete: :cascade
- add_foreign_key "boards", "namespaces", column: "group_id", on_delete: :cascade
+ add_foreign_key "boards", "namespaces", column: "group_id", name: "fk_1e9a074a35", on_delete: :cascade
add_foreign_key "boards", "projects", name: "fk_f15266b5f9", on_delete: :cascade
add_foreign_key "chat_teams", "namespaces", on_delete: :cascade
add_foreign_key "ci_build_needs", "ci_builds", column: "build_id", on_delete: :cascade
@@ -3834,7 +3846,7 @@ ActiveRecord::Schema.define(version: 2019_09_12_061145) do
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
- add_foreign_key "clusters_applications_ingress", "clusters", name: "fk_753a7b41c1", on_delete: :cascade
+ add_foreign_key "clusters_applications_ingress", "clusters", on_delete: :cascade
add_foreign_key "clusters_applications_jupyter", "clusters", on_delete: :cascade
add_foreign_key "clusters_applications_jupyter", "oauth_applications", on_delete: :nullify
add_foreign_key "clusters_applications_knative", "clusters", on_delete: :cascade
@@ -3846,8 +3858,8 @@ ActiveRecord::Schema.define(version: 2019_09_12_061145) do
add_foreign_key "clusters_kubernetes_namespaces", "environments", on_delete: :nullify
add_foreign_key "clusters_kubernetes_namespaces", "projects", on_delete: :nullify
add_foreign_key "container_repositories", "projects"
- add_foreign_key "dependency_proxy_blobs", "namespaces", column: "group_id", name: "fk_db58bbc5d7", on_delete: :cascade
- add_foreign_key "dependency_proxy_group_settings", "namespaces", column: "group_id", name: "fk_616ddd680a", on_delete: :cascade
+ add_foreign_key "dependency_proxy_blobs", "namespaces", column: "group_id", on_delete: :cascade
+ add_foreign_key "dependency_proxy_group_settings", "namespaces", column: "group_id", on_delete: :cascade
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
@@ -3924,14 +3936,15 @@ ActiveRecord::Schema.define(version: 2019_09_12_061145) do
add_foreign_key "issue_links", "issues", column: "target_id", name: "fk_e71bb44f1f", on_delete: :cascade
add_foreign_key "issue_metrics", "issues", on_delete: :cascade
add_foreign_key "issue_tracker_data", "services", on_delete: :cascade
+ add_foreign_key "issues", "issues", column: "duplicated_to_id", name: "fk_9c4516d665", on_delete: :nullify
add_foreign_key "issues", "issues", column: "moved_to_id", name: "fk_a194299be1", on_delete: :nullify
add_foreign_key "issues", "milestones", name: "fk_96b1dd429c", on_delete: :nullify
add_foreign_key "issues", "projects", name: "fk_899c8f3231", on_delete: :cascade
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 "jira_connect_subscriptions", "jira_connect_installations", name: "fk_f1d617343f", on_delete: :cascade
- add_foreign_key "jira_connect_subscriptions", "namespaces", name: "fk_a3c10bcf7d", 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
add_foreign_key "label_links", "labels", name: "fk_d97dd08678", on_delete: :cascade
add_foreign_key "label_priorities", "labels", on_delete: :cascade
@@ -4018,7 +4031,7 @@ ActiveRecord::Schema.define(version: 2019_09_12_061145) do
add_foreign_key "project_import_data", "projects", name: "fk_ffb9ee3a10", on_delete: :cascade
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", on_delete: :cascade
+ add_foreign_key "project_mirror_data", "projects", name: "fk_d1aad367d7", 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
@@ -4054,7 +4067,7 @@ ActiveRecord::Schema.define(version: 2019_09_12_061145) do
add_foreign_key "release_links", "releases", on_delete: :cascade
add_foreign_key "releases", "projects", name: "fk_47fe2a0596", on_delete: :cascade
add_foreign_key "releases", "users", column: "author_id", name: "fk_8e4456f90f", on_delete: :nullify
- add_foreign_key "remote_mirrors", "projects", on_delete: :cascade
+ add_foreign_key "remote_mirrors", "projects", name: "fk_43a9aa4ca8", on_delete: :cascade
add_foreign_key "repository_languages", "projects", on_delete: :cascade
add_foreign_key "resource_label_events", "epics", on_delete: :cascade
add_foreign_key "resource_label_events", "issues", on_delete: :cascade