schema.rb 145 KB
Newer Older
Andrew8xx8's avatar
Andrew8xx8 committed
1 2 3 4 5 6 7 8 9 10 11
# encoding: UTF-8
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative source for your
# database schema. If you need to create the application database on another
# system, you should be using db:schema:load, not running all the migrations
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
# you'll amass, the slower it'll run and the greater likelihood for issues).
#
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
12
# It's strongly recommended that you check this file into your version control system.
Andrew8xx8's avatar
Andrew8xx8 committed
13

14
ActiveRecord::Schema.define(version: 20180722103201) do
Valery Sizov's avatar
Valery Sizov committed
15

16 17
  # These are extensions that must be enabled in order to support this database
  enable_extension "plpgsql"
18
  enable_extension "pg_trgm"
19

Valery Sizov's avatar
Valery Sizov committed
20
  create_table "abuse_reports", force: :cascade do |t|
21 22 23
    t.integer "reporter_id"
    t.integer "user_id"
    t.text "message"
24 25
    t.datetime "created_at"
    t.datetime "updated_at"
26
    t.text "message_html"
27
    t.integer "cached_markdown_version"
28 29
  end

Valery Sizov's avatar
Valery Sizov committed
30
  create_table "appearances", force: :cascade do |t|
31 32
    t.string "title", null: false
    t.text "description", null: false
33 34
    t.string "logo"
    t.integer "updated_by"
35
    t.string "header_logo"
36 37
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
38
    t.text "description_html"
39
    t.integer "cached_markdown_version"
40 41
    t.text "new_project_guidelines"
    t.text "new_project_guidelines_html"
Micaël Bergeron's avatar
Micaël Bergeron committed
42
    t.string "favicon"
43 44 45 46
    t.text "header_message"
    t.text "header_message_html"
    t.text "footer_message"
    t.text "footer_message_html"
47 48
    t.text "message_background_color"
    t.text "message_font_color"
Valery Sizov's avatar
Valery Sizov committed
49 50
  end

51 52 53 54 55 56
  create_table "application_setting_terms", force: :cascade do |t|
    t.integer "cached_markdown_version"
    t.text "terms", null: false
    t.text "terms_html"
  end

Valery Sizov's avatar
Valery Sizov committed
57
  create_table "application_settings", force: :cascade do |t|
58 59 60 61
    t.integer "default_projects_limit"
    t.boolean "signup_enabled"
    t.boolean "gravatar_enabled"
    t.text "sign_in_text"
62 63
    t.datetime "created_at"
    t.datetime "updated_at"
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
    t.string "home_page_url"
    t.integer "default_branch_protection", default: 2
    t.text "help_text"
    t.text "restricted_visibility_levels"
    t.boolean "version_check_enabled", default: true
    t.integer "max_attachment_size", default: 10, null: false
    t.integer "default_project_visibility"
    t.integer "default_snippet_visibility"
    t.text "domain_whitelist"
    t.boolean "user_oauth_applications", default: true
    t.string "after_sign_out_path"
    t.integer "session_expire_delay", default: 10080, null: false
    t.text "import_sources"
    t.text "help_page_text"
    t.string "admin_notification_email"
    t.boolean "shared_runners_enabled", default: true, null: false
    t.integer "max_artifacts_size", default: 100, null: false
    t.string "runners_registration_token"
    t.integer "max_pages_size", default: 100, null: false
    t.boolean "require_two_factor_authentication", default: false
    t.integer "two_factor_grace_period", default: 48
    t.boolean "metrics_enabled", default: false
    t.string "metrics_host", default: "localhost"
    t.integer "metrics_pool_size", default: 16
    t.integer "metrics_timeout", default: 10
    t.integer "metrics_method_call_threshold", default: 10
    t.boolean "recaptcha_enabled", default: false
    t.string "recaptcha_site_key"
    t.string "recaptcha_private_key"
    t.integer "metrics_port", default: 8089
    t.boolean "akismet_enabled", default: false
    t.string "akismet_api_key"
    t.integer "metrics_sample_interval", default: 15
    t.boolean "sentry_enabled", default: false
    t.string "sentry_dsn"
    t.boolean "email_author_in_body", default: false
    t.integer "default_group_visibility"
    t.boolean "repository_checks_enabled", default: false
    t.text "shared_runners_text"
    t.integer "metrics_packet_size", default: 1
    t.text "disabled_oauth_sign_in_sources"
    t.string "health_check_access_token"
    t.boolean "send_user_confirmation_email", default: false
    t.integer "container_registry_token_expire_delay", default: 5
    t.text "after_sign_up_text"
    t.boolean "user_default_external", default: false, null: false
    t.boolean "elasticsearch_indexing", default: false, null: false
    t.boolean "elasticsearch_search", default: false, null: false
112
    t.string "repository_storages", default: "default"
113 114 115 116 117 118 119 120 121 122
    t.string "enabled_git_access_protocol"
    t.boolean "domain_blacklist_enabled", default: false
    t.text "domain_blacklist"
    t.boolean "usage_ping_enabled", default: true, null: false
    t.boolean "koding_enabled"
    t.string "koding_url"
    t.text "sign_in_text_html"
    t.text "help_page_text_html"
    t.text "shared_runners_text_html"
    t.text "after_sign_up_text_html"
123
    t.integer "rsa_key_restriction", default: 0, null: false
124
    t.integer "dsa_key_restriction", default: -1, null: false
125 126
    t.integer "ecdsa_key_restriction", default: 0, null: false
    t.integer "ed25519_key_restriction", default: 0, null: false
127 128 129 130 131
    t.boolean "housekeeping_enabled", default: true, null: false
    t.boolean "housekeeping_bitmaps_enabled", default: true, null: false
    t.integer "housekeeping_incremental_repack_period", default: 10, null: false
    t.integer "housekeeping_full_repack_period", default: 50, null: false
    t.integer "housekeeping_gc_period", default: 200, null: false
132 133 134
    t.boolean "sidekiq_throttling_enabled", default: false
    t.string "sidekiq_throttling_queues"
    t.decimal "sidekiq_throttling_factor"
135
    t.boolean "html_emails_enabled", default: true
136 137
    t.string "plantuml_url"
    t.boolean "plantuml_enabled"
138
    t.integer "shared_runners_minutes", default: 0, null: false
139
    t.integer "repository_size_limit", limit: 8, default: 0
140
    t.integer "terminal_max_session_time", default: 0, null: false
141 142 143
    t.integer "unique_ips_limit_per_user"
    t.integer "unique_ips_limit_time_window"
    t.boolean "unique_ips_limit_enabled", default: false, null: false
144 145 146 147 148 149
    t.string "default_artifacts_expire_in", default: "0", null: false
    t.string "elasticsearch_url", default: "http://localhost:9200"
    t.boolean "elasticsearch_aws", default: false, null: false
    t.string "elasticsearch_aws_region", default: "us-east-1"
    t.string "elasticsearch_aws_access_key"
    t.string "elasticsearch_aws_secret_access_key"
150
    t.integer "geo_status_timeout", default: 10
151
    t.string "uuid"
152
    t.decimal "polling_interval_multiplier", default: 1.0, null: false
153
    t.boolean "elasticsearch_experimental_indexer"
154
    t.integer "cached_markdown_version"
155 156
    t.boolean "clientside_sentry_enabled", default: false, null: false
    t.string "clientside_sentry_dsn"
157
    t.boolean "check_namespace_plan", default: false, null: false
158
    t.integer "mirror_max_delay", default: 300, null: false
159 160
    t.integer "mirror_max_capacity", default: 100, null: false
    t.integer "mirror_capacity_threshold", default: 50, null: false
161
    t.boolean "prometheus_metrics_enabled", default: true, null: false
162
    t.boolean "authorized_keys_enabled", default: true, null: false
163 164
    t.boolean "help_page_hide_commercial_content", default: false
    t.string "help_page_support_url"
Valery Sizov's avatar
Valery Sizov committed
165 166 167 168
    t.boolean "slack_app_enabled", default: false
    t.string "slack_app_id"
    t.string "slack_app_secret"
    t.string "slack_app_verification_token"
169
    t.integer "performance_bar_allowed_group_id"
170
    t.boolean "allow_group_owners_to_manage_ldap", default: true, null: false
171
    t.boolean "hashed_storage_enabled", default: false, null: false
172
    t.boolean "project_export_enabled", default: true, null: false
Jarka Kadlecova's avatar
Jarka Kadlecova committed
173
    t.boolean "auto_devops_enabled", default: false, null: false
174
    t.integer "circuitbreaker_failure_count_threshold", default: 3
175
    t.integer "circuitbreaker_failure_reset_time", default: 1800
176
    t.integer "circuitbreaker_storage_timeout", default: 15
177
    t.integer "circuitbreaker_access_retries", default: 3
178 179 180 181 182 183 184 185 186
    t.boolean "throttle_unauthenticated_enabled", default: false, null: false
    t.integer "throttle_unauthenticated_requests_per_period", default: 3600, null: false
    t.integer "throttle_unauthenticated_period_in_seconds", default: 3600, null: false
    t.boolean "throttle_authenticated_api_enabled", default: false, null: false
    t.integer "throttle_authenticated_api_requests_per_period", default: 7200, null: false
    t.integer "throttle_authenticated_api_period_in_seconds", default: 3600, null: false
    t.boolean "throttle_authenticated_web_enabled", default: false, null: false
    t.integer "throttle_authenticated_web_requests_per_period", default: 7200, null: false
    t.integer "throttle_authenticated_web_period_in_seconds", default: 3600, null: false
187
    t.integer "circuitbreaker_check_interval", default: 1, null: false
188 189
    t.boolean "password_authentication_enabled_for_web"
    t.boolean "password_authentication_enabled_for_git", default: true
190 191 192
    t.integer "gitaly_timeout_default", default: 55, null: false
    t.integer "gitaly_timeout_medium", default: 30, null: false
    t.integer "gitaly_timeout_fast", default: 10, null: false
193
    t.boolean "mirror_available", default: true, null: false
194
    t.string "auto_devops_domain"
195
    t.integer "default_project_creation", default: 2, null: false
196 197 198
    t.boolean "external_authorization_service_enabled", default: false, null: false
    t.string "external_authorization_service_url"
    t.string "external_authorization_service_default_label"
199
    t.boolean "pages_domain_verification_enabled", default: true, null: false
Micaël Bergeron's avatar
Micaël Bergeron committed
200
    t.float "external_authorization_service_timeout", default: 0.5, null: false
201
    t.boolean "allow_local_requests_from_hooks_and_services", default: false, null: false
202 203 204 205 206
    t.text "external_auth_client_cert"
    t.text "encrypted_external_auth_client_key"
    t.string "encrypted_external_auth_client_key_iv"
    t.string "encrypted_external_auth_client_key_pass"
    t.string "encrypted_external_auth_client_key_pass_iv"
207
    t.string "email_additional_text"
208
    t.boolean "enforce_terms", default: false
209
    t.boolean "pseudonymizer_enabled", default: false, null: false
210
    t.boolean "hide_third_party_offers", default: false, null: false
Valery Sizov's avatar
Valery Sizov committed
211 212 213
  end

  create_table "approvals", force: :cascade do |t|
214 215
    t.integer "merge_request_id", null: false
    t.integer "user_id", null: false
Valery Sizov's avatar
Valery Sizov committed
216 217
    t.datetime "created_at"
    t.datetime "updated_at"
218 219
  end

220 221
  add_index "approvals", ["merge_request_id"], name: "index_approvals_on_merge_request_id", using: :btree

Valery Sizov's avatar
Valery Sizov committed
222
  create_table "approver_groups", force: :cascade do |t|
223 224 225
    t.integer "target_id", null: false
    t.string "target_type", null: false
    t.integer "group_id", null: false
Valery Sizov's avatar
Valery Sizov committed
226 227 228 229 230 231 232
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "approver_groups", ["group_id"], name: "index_approver_groups_on_group_id", using: :btree
  add_index "approver_groups", ["target_id", "target_type"], name: "index_approver_groups_on_target_id_and_target_type", using: :btree

Valery Sizov's avatar
Valery Sizov committed
233
  create_table "approvers", force: :cascade do |t|
234 235 236
    t.integer "target_id", null: false
    t.string "target_type"
    t.integer "user_id", null: false
Valery Sizov's avatar
Valery Sizov committed
237 238 239 240 241 242 243 244
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "approvers", ["target_id", "target_type"], name: "index_approvers_on_target_id_and_target_type", using: :btree
  add_index "approvers", ["user_id"], name: "index_approvers_on_user_id", using: :btree

  create_table "audit_events", force: :cascade do |t|
245 246 247 248 249
    t.integer "author_id", null: false
    t.string "type", null: false
    t.integer "entity_id", null: false
    t.string "entity_type", null: false
    t.text "details"
Marin Jankovski's avatar
Marin Jankovski committed
250 251 252 253 254 255
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "audit_events", ["entity_id", "entity_type"], name: "index_audit_events_on_entity_id_and_entity_type", using: :btree

256
  create_table "award_emoji", force: :cascade do |t|
257 258 259 260
    t.string "name"
    t.integer "user_id"
    t.integer "awardable_id"
    t.string "awardable_type"
261 262 263 264
    t.datetime "created_at"
    t.datetime "updated_at"
  end

Z.J. van de Weg's avatar
Z.J. van de Weg committed
265
  add_index "award_emoji", ["awardable_type", "awardable_id"], name: "index_award_emoji_on_awardable_type_and_awardable_id", using: :btree
266
  add_index "award_emoji", ["user_id", "name"], name: "index_award_emoji_on_user_id_and_name", using: :btree
267

268 269 270 271 272 273 274 275 276 277 278 279 280
  create_table "badges", force: :cascade do |t|
    t.string "link_url", null: false
    t.string "image_url", null: false
    t.integer "project_id"
    t.integer "group_id"
    t.string "type", null: false
    t.datetime_with_timezone "created_at", null: false
    t.datetime_with_timezone "updated_at", null: false
  end

  add_index "badges", ["group_id"], name: "index_badges_on_group_id", using: :btree
  add_index "badges", ["project_id"], name: "index_badges_on_project_id", using: :btree

281 282 283 284 285 286 287
  create_table "board_assignees", force: :cascade do |t|
    t.integer "board_id", null: false
    t.integer "assignee_id", null: false
  end

  add_index "board_assignees", ["board_id", "assignee_id"], name: "index_board_assignees_on_board_id_and_assignee_id", unique: true, using: :btree

288
  create_table "board_labels", force: :cascade do |t|
289
    t.integer "board_id", null: false
Oswaldo Ferreira's avatar
Oswaldo Ferreira committed
290 291 292
    t.integer "label_id", null: false
  end

293
  add_index "board_labels", ["board_id", "label_id"], name: "index_board_labels_on_board_id_and_label_id", unique: true, using: :btree
Oswaldo Ferreira's avatar
Oswaldo Ferreira committed
294

295
  create_table "boards", force: :cascade do |t|
296
    t.integer "project_id"
297 298
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
299
    t.string "name", default: "Development", null: false
300
    t.integer "milestone_id"
Felipe Artur's avatar
Felipe Artur committed
301
    t.integer "group_id"
302
    t.integer "weight"
303 304
  end

Felipe Artur's avatar
Felipe Artur committed
305
  add_index "boards", ["group_id"], name: "index_boards_on_group_id", using: :btree
306
  add_index "boards", ["milestone_id"], name: "index_boards_on_milestone_id", using: :btree
307 308
  add_index "boards", ["project_id"], name: "index_boards_on_project_id", using: :btree

Valery Sizov's avatar
Valery Sizov committed
309
  create_table "broadcast_messages", force: :cascade do |t|
310
    t.text "message", null: false
311 312 313 314
    t.datetime "starts_at", null: false
    t.datetime "ends_at", null: false
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
315 316
    t.string "color"
    t.string "font"
317
    t.text "message_html", null: false
318
    t.integer "cached_markdown_version"
319
  end
320

321 322
  add_index "broadcast_messages", ["starts_at", "ends_at", "id"], name: "index_broadcast_messages_on_starts_at_and_ends_at_and_id", using: :btree

323 324 325
  create_table "chat_names", force: :cascade do |t|
    t.integer "user_id", null: false
    t.integer "service_id", null: false
326
    t.string "team_id", null: false
327
    t.string "team_domain"
328
    t.string "chat_id", null: false
329
    t.string "chat_name"
330
    t.datetime "last_used_at"
331 332
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
333 334
  end

335
  add_index "chat_names", ["service_id", "team_id", "chat_id"], name: "index_chat_names_on_service_id_and_team_id_and_chat_id", unique: true, using: :btree
336 337
  add_index "chat_names", ["user_id", "service_id"], name: "index_chat_names_on_user_id_and_service_id", unique: true, using: :btree

338
  create_table "chat_teams", force: :cascade do |t|
339
    t.integer "namespace_id", null: false
340 341 342 343 344 345
    t.string "team_id"
    t.string "name"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
  end

346
  add_index "chat_teams", ["namespace_id"], name: "index_chat_teams_on_namespace_id", unique: true, using: :btree
347

348 349 350 351 352 353 354 355 356
  create_table "ci_build_trace_chunks", id: :bigserial, force: :cascade do |t|
    t.integer "build_id", null: false
    t.integer "chunk_index", null: false
    t.integer "data_store", null: false
    t.binary "raw_data"
  end

  add_index "ci_build_trace_chunks", ["build_id", "chunk_index"], name: "index_ci_build_trace_chunks_on_build_id_and_chunk_index", unique: true, using: :btree

357 358 359 360 361 362 363 364
  create_table "ci_build_trace_section_names", force: :cascade do |t|
    t.integer "project_id", null: false
    t.string "name", null: false
  end

  add_index "ci_build_trace_section_names", ["project_id", "name"], name: "index_ci_build_trace_section_names_on_project_id_and_name", unique: true, using: :btree

  create_table "ci_build_trace_sections", force: :cascade do |t|
365
    t.integer "project_id", null: false
366 367
    t.datetime "date_start", null: false
    t.datetime "date_end", null: false
368 369 370 371 372 373 374 375
    t.integer "byte_start", limit: 8, null: false
    t.integer "byte_end", limit: 8, null: false
    t.integer "build_id", null: false
    t.integer "section_name_id", null: false
  end

  add_index "ci_build_trace_sections", ["build_id", "section_name_id"], name: "index_ci_build_trace_sections_on_build_id_and_section_name_id", unique: true, using: :btree
  add_index "ci_build_trace_sections", ["project_id"], name: "index_ci_build_trace_sections_on_project_id", using: :btree
376
  add_index "ci_build_trace_sections", ["section_name_id"], name: "index_ci_build_trace_sections_on_section_name_id", using: :btree
377

Valery Sizov's avatar
Valery Sizov committed
378
  create_table "ci_builds", force: :cascade do |t|
379
    t.string "status"
380
    t.datetime "finished_at"
381
    t.text "trace"
382 383 384
    t.datetime "created_at"
    t.datetime "updated_at"
    t.datetime "started_at"
385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401
    t.integer "runner_id"
    t.float "coverage"
    t.integer "commit_id"
    t.text "commands"
    t.string "name"
    t.text "options"
    t.boolean "allow_failure", default: false, null: false
    t.string "stage"
    t.integer "trigger_request_id"
    t.integer "stage_idx"
    t.boolean "tag"
    t.string "ref"
    t.integer "user_id"
    t.string "type"
    t.string "target_url"
    t.string "description"
    t.text "artifacts_file"
402
    t.integer "project_id"
403 404
    t.text "artifacts_metadata"
    t.integer "erased_by_id"
405
    t.datetime "erased_at"
406
    t.datetime "artifacts_expire_at"
407 408 409 410
    t.string "environment"
    t.integer "artifacts_size", limit: 8
    t.string "when"
    t.text "yaml_variables"
411
    t.datetime "queued_at"
412
    t.string "token"
Kamil Trzcinski's avatar
Kamil Trzcinski committed
413
    t.integer "lock_version"
414
    t.string "coverage_regex"
415
    t.integer "auto_canceled_by_id"
416
    t.boolean "retried"
417
    t.integer "stage_id"
Rémy Coutable's avatar
Rémy Coutable committed
418 419
    t.integer "artifacts_file_store"
    t.integer "artifacts_metadata_store"
420
    t.boolean "protected"
421
    t.integer "failure_reason"
422 423
  end

424
  add_index "ci_builds", ["artifacts_expire_at"], name: "index_ci_builds_on_artifacts_expire_at", where: "(artifacts_file <> ''::text)", using: :btree
425
  add_index "ci_builds", ["auto_canceled_by_id"], name: "index_ci_builds_on_auto_canceled_by_id", using: :btree
426
  add_index "ci_builds", ["commit_id", "stage_idx", "created_at"], name: "index_ci_builds_on_commit_id_and_stage_idx_and_created_at", using: :btree
427
  add_index "ci_builds", ["commit_id", "status", "type"], name: "index_ci_builds_on_commit_id_and_status_and_type", using: :btree
428 429
  add_index "ci_builds", ["commit_id", "type", "name", "ref"], name: "index_ci_builds_on_commit_id_and_type_and_name_and_ref", using: :btree
  add_index "ci_builds", ["commit_id", "type", "ref"], name: "index_ci_builds_on_commit_id_and_type_and_ref", using: :btree
430
  add_index "ci_builds", ["project_id", "id"], name: "index_ci_builds_on_project_id_and_id", using: :btree
431
  add_index "ci_builds", ["protected"], name: "index_ci_builds_on_protected", using: :btree
432
  add_index "ci_builds", ["runner_id"], name: "index_ci_builds_on_runner_id", using: :btree
433
  add_index "ci_builds", ["stage_id", "stage_idx"], name: "tmp_build_stage_position_index", where: "(stage_idx IS NOT NULL)", using: :btree
434
  add_index "ci_builds", ["stage_id"], name: "index_ci_builds_on_stage_id", using: :btree
435
  add_index "ci_builds", ["status", "type", "runner_id"], name: "index_ci_builds_on_status_and_type_and_runner_id", using: :btree
436
  add_index "ci_builds", ["status"], name: "index_ci_builds_on_status", using: :btree
Kamil Trzcinski's avatar
Kamil Trzcinski committed
437
  add_index "ci_builds", ["token"], name: "index_ci_builds_on_token", unique: true, using: :btree
438
  add_index "ci_builds", ["updated_at"], name: "index_ci_builds_on_updated_at", using: :btree
439
  add_index "ci_builds", ["user_id"], name: "index_ci_builds_on_user_id", using: :btree
440

441 442 443 444 445 446 447 448 449 450
  create_table "ci_builds_metadata", force: :cascade do |t|
    t.integer "build_id", null: false
    t.integer "project_id", null: false
    t.integer "timeout"
    t.integer "timeout_source", default: 1, null: false
  end

  add_index "ci_builds_metadata", ["build_id"], name: "index_ci_builds_metadata_on_build_id", unique: true, using: :btree
  add_index "ci_builds_metadata", ["project_id"], name: "index_ci_builds_metadata_on_project_id", using: :btree

451
  create_table "ci_builds_runner_session", id: :bigserial, force: :cascade do |t|
452 453 454 455 456 457 458 459
    t.integer "build_id", null: false
    t.string "url", null: false
    t.string "certificate"
    t.string "authorization"
  end

  add_index "ci_builds_runner_session", ["build_id"], name: "index_ci_builds_runner_session_on_build_id", unique: true, using: :btree

Shinya Maeda's avatar
fix  
Shinya Maeda committed
460
  create_table "ci_group_variables", force: :cascade do |t|
461 462 463 464 465
    t.string "key", null: false
    t.text "value"
    t.text "encrypted_value"
    t.string "encrypted_value_salt"
    t.string "encrypted_value_iv"
Shinya Maeda's avatar
fix  
Shinya Maeda committed
466 467
    t.integer "group_id", null: false
    t.boolean "protected", default: false, null: false
468 469
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
470 471
  end

Shinya Maeda's avatar
fix  
Shinya Maeda committed
472
  add_index "ci_group_variables", ["group_id", "key"], name: "index_ci_group_variables_on_group_id_and_key", unique: true, using: :btree
473

474 475
  create_table "ci_job_artifacts", force: :cascade do |t|
    t.integer "project_id", null: false
476
    t.integer "job_id", null: false
477
    t.integer "file_type", null: false
478
    t.integer "size", limit: 8
479 480
    t.datetime_with_timezone "created_at", null: false
    t.datetime_with_timezone "updated_at", null: false
481
    t.datetime_with_timezone "expire_at"
482
    t.string "file"
483
    t.integer "file_store"
484
    t.binary "file_sha256"
485 486
  end

487
  add_index "ci_job_artifacts", ["expire_at", "job_id"], name: "index_ci_job_artifacts_on_expire_at_and_job_id", using: :btree
488
  add_index "ci_job_artifacts", ["file_store"], name: "index_ci_job_artifacts_on_file_store", using: :btree
489
  add_index "ci_job_artifacts", ["job_id", "file_type"], name: "index_ci_job_artifacts_on_job_id_and_file_type", unique: true, using: :btree
490 491
  add_index "ci_job_artifacts", ["project_id"], name: "index_ci_job_artifacts_on_project_id", using: :btree

492 493 494 495 496 497 498 499
  create_table "ci_pipeline_chat_data", id: :bigserial, force: :cascade do |t|
    t.integer "pipeline_id", null: false
    t.integer "chat_name_id", null: false
    t.text "response_url", null: false
  end

  add_index "ci_pipeline_chat_data", ["pipeline_id"], name: "index_ci_pipeline_chat_data_on_pipeline_id", unique: true, using: :btree

Shinya Maeda's avatar
fix  
Shinya Maeda committed
500
  create_table "ci_pipeline_schedule_variables", force: :cascade do |t|
Shinya Maeda's avatar
Shinya Maeda committed
501 502 503 504 505
    t.string "key", null: false
    t.text "value"
    t.text "encrypted_value"
    t.string "encrypted_value_salt"
    t.string "encrypted_value_iv"
Shinya Maeda's avatar
fix  
Shinya Maeda committed
506
    t.integer "pipeline_schedule_id", null: false
507 508
    t.datetime "created_at"
    t.datetime "updated_at"
Shinya Maeda's avatar
Shinya Maeda committed
509 510
  end

Shinya Maeda's avatar
fix  
Shinya Maeda committed
511
  add_index "ci_pipeline_schedule_variables", ["pipeline_schedule_id", "key"], name: "index_ci_pipeline_schedule_variables_on_schedule_id_and_key", unique: true, using: :btree
Shinya Maeda's avatar
Shinya Maeda committed
512

513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528
  create_table "ci_pipeline_schedules", force: :cascade do |t|
    t.string "description"
    t.string "ref"
    t.string "cron"
    t.string "cron_timezone"
    t.datetime "next_run_at"
    t.integer "project_id"
    t.integer "owner_id"
    t.boolean "active", default: true
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "ci_pipeline_schedules", ["next_run_at", "active"], name: "index_ci_pipeline_schedules_on_next_run_at_and_active", using: :btree
  add_index "ci_pipeline_schedules", ["project_id"], name: "index_ci_pipeline_schedules_on_project_id", using: :btree

529 530 531 532 533 534 535 536 537 538 539
  create_table "ci_pipeline_variables", force: :cascade do |t|
    t.string "key", null: false
    t.text "value"
    t.text "encrypted_value"
    t.string "encrypted_value_salt"
    t.string "encrypted_value_iv"
    t.integer "pipeline_id", null: false
  end

  add_index "ci_pipeline_variables", ["pipeline_id", "key"], name: "index_ci_pipeline_variables_on_pipeline_id_and_key", unique: true, using: :btree

540
  create_table "ci_pipelines", force: :cascade do |t|
541 542 543
    t.string "ref"
    t.string "sha"
    t.string "before_sha"
544 545
    t.datetime "created_at"
    t.datetime "updated_at"
546 547
    t.boolean "tag", default: false
    t.text "yaml_errors"
548
    t.datetime "committed_at"
549
    t.integer "project_id"
550
    t.string "status"
Kamil Trzcinski's avatar
Kamil Trzcinski committed
551 552
    t.datetime "started_at"
    t.datetime "finished_at"
553 554
    t.integer "duration"
    t.integer "user_id"
Kamil Trzcinski's avatar
Kamil Trzcinski committed
555
    t.integer "lock_version"
556
    t.integer "auto_canceled_by_id"
557
    t.integer "pipeline_schedule_id"
558
    t.integer "source"
559
    t.integer "config_source"
560
    t.boolean "protected"
561
    t.integer "failure_reason"
Micaël Bergeron's avatar
Micaël Bergeron committed
562
    t.integer "iid"
563 564
  end

565
  add_index "ci_pipelines", ["auto_canceled_by_id"], name: "index_ci_pipelines_on_auto_canceled_by_id", using: :btree
566
  add_index "ci_pipelines", ["pipeline_schedule_id"], name: "index_ci_pipelines_on_pipeline_schedule_id", using: :btree
Micaël Bergeron's avatar
Micaël Bergeron committed
567
  add_index "ci_pipelines", ["project_id", "iid"], name: "index_ci_pipelines_on_project_id_and_iid", unique: true, where: "(iid IS NOT NULL)", using: :btree
568
  add_index "ci_pipelines", ["project_id", "ref", "status", "id"], name: "index_ci_pipelines_on_project_id_and_ref_and_status_and_id", using: :btree
569 570 571 572
  add_index "ci_pipelines", ["project_id", "sha"], name: "index_ci_pipelines_on_project_id_and_sha", using: :btree
  add_index "ci_pipelines", ["project_id"], name: "index_ci_pipelines_on_project_id", using: :btree
  add_index "ci_pipelines", ["status"], name: "index_ci_pipelines_on_status", using: :btree
  add_index "ci_pipelines", ["user_id"], name: "index_ci_pipelines_on_user_id", using: :btree
573

574
  create_table "ci_runner_namespaces", force: :cascade do |t|
575
    t.integer "runner_id"
576
    t.integer "namespace_id"
577 578
  end

579 580
  add_index "ci_runner_namespaces", ["namespace_id"], name: "index_ci_runner_namespaces_on_namespace_id", using: :btree
  add_index "ci_runner_namespaces", ["runner_id", "namespace_id"], name: "index_ci_runner_namespaces_on_runner_id_and_namespace_id", unique: true, using: :btree
581

Valery Sizov's avatar
Valery Sizov committed
582
  create_table "ci_runner_projects", force: :cascade do |t|
583
    t.integer "runner_id", null: false
584 585
    t.datetime "created_at"
    t.datetime "updated_at"
586
    t.integer "project_id"
587 588
  end

589
  add_index "ci_runner_projects", ["project_id"], name: "index_ci_runner_projects_on_project_id", using: :btree
590 591
  add_index "ci_runner_projects", ["runner_id"], name: "index_ci_runner_projects_on_runner_id", using: :btree

Valery Sizov's avatar
Valery Sizov committed
592
  create_table "ci_runners", force: :cascade do |t|
593
    t.string "token"
594 595
    t.datetime "created_at"
    t.datetime "updated_at"
596
    t.string "description"
597
    t.datetime "contacted_at"
598 599 600 601 602 603 604 605 606
    t.boolean "active", default: true, null: false
    t.boolean "is_shared", default: false
    t.string "name"
    t.string "version"
    t.string "revision"
    t.string "platform"
    t.string "architecture"
    t.boolean "run_untagged", default: true, null: false
    t.boolean "locked", default: false, null: false
607
    t.integer "access_level", default: 0, null: false
608
    t.string "ip_address"
609
    t.integer "maximum_timeout"
610
    t.integer "runner_type", limit: 2, null: false
611 612
  end

613
  add_index "ci_runners", ["contacted_at"], name: "index_ci_runners_on_contacted_at", using: :btree
614
  add_index "ci_runners", ["is_shared"], name: "index_ci_runners_on_is_shared", using: :btree
615
  add_index "ci_runners", ["locked"], name: "index_ci_runners_on_locked", using: :btree
616
  add_index "ci_runners", ["runner_type"], name: "index_ci_runners_on_runner_type", using: :btree
617
  add_index "ci_runners", ["token"], name: "index_ci_runners_on_token", using: :btree
618

Kamil Trzcinski's avatar
Kamil Trzcinski committed
619 620 621 622 623 624 625 626
  create_table "ci_sources_pipelines", force: :cascade do |t|
    t.integer "project_id"
    t.integer "pipeline_id"
    t.integer "source_project_id"
    t.integer "source_job_id"
    t.integer "source_pipeline_id"
  end

627 628 629 630 631
  add_index "ci_sources_pipelines", ["pipeline_id"], name: "index_ci_sources_pipelines_on_pipeline_id", using: :btree
  add_index "ci_sources_pipelines", ["project_id"], name: "index_ci_sources_pipelines_on_project_id", using: :btree
  add_index "ci_sources_pipelines", ["source_job_id"], name: "index_ci_sources_pipelines_on_source_job_id", using: :btree
  add_index "ci_sources_pipelines", ["source_pipeline_id"], name: "index_ci_sources_pipelines_on_source_pipeline_id", using: :btree
  add_index "ci_sources_pipelines", ["source_project_id"], name: "index_ci_sources_pipelines_on_source_project_id", using: :btree
Nick Thomas's avatar
Nick Thomas committed
632

633 634 635 636 637
  create_table "ci_stages", force: :cascade do |t|
    t.integer "project_id"
    t.integer "pipeline_id"
    t.datetime "created_at"
    t.datetime "updated_at"
638
    t.string "name"
639
    t.integer "status"
640
    t.integer "lock_version"
641
    t.integer "position"
642 643
  end

644
  add_index "ci_stages", ["pipeline_id", "name"], name: "index_ci_stages_on_pipeline_id_and_name", unique: true, using: :btree
645
  add_index "ci_stages", ["pipeline_id", "position"], name: "index_ci_stages_on_pipeline_id_and_position", using: :btree
646 647
  add_index "ci_stages", ["pipeline_id"], name: "index_ci_stages_on_pipeline_id", using: :btree
  add_index "ci_stages", ["project_id"], name: "index_ci_stages_on_project_id", using: :btree
Kamil Trzcinski's avatar
Kamil Trzcinski committed
648

Valery Sizov's avatar
Valery Sizov committed
649
  create_table "ci_trigger_requests", force: :cascade do |t|
650 651
    t.integer "trigger_id", null: false
    t.text "variables"
652 653
    t.datetime "created_at"
    t.datetime "updated_at"
654
    t.integer "commit_id"
655 656
  end

657 658
  add_index "ci_trigger_requests", ["commit_id"], name: "index_ci_trigger_requests_on_commit_id", using: :btree

Valery Sizov's avatar
Valery Sizov committed
659
  create_table "ci_triggers", force: :cascade do |t|
660
    t.string "token"
661 662
    t.datetime "created_at"
    t.datetime "updated_at"
663
    t.integer "project_id"
Kamil Trzcinski's avatar
Kamil Trzcinski committed
664 665
    t.integer "owner_id"
    t.string "description"
Shinya Maeda's avatar
Shinya Maeda committed
666
    t.string "ref"
667 668
  end

669
  add_index "ci_triggers", ["project_id"], name: "index_ci_triggers_on_project_id", using: :btree
670

Valery Sizov's avatar
Valery Sizov committed
671
  create_table "ci_variables", force: :cascade do |t|
672
    t.string "key", null: false
673 674 675 676
    t.text "value"
    t.text "encrypted_value"
    t.string "encrypted_value_salt"
    t.string "encrypted_value_iv"
677
    t.integer "project_id", null: false
678
    t.boolean "protected", default: false, null: false
679
    t.string "environment_scope", default: "*", null: false
680 681
  end

682
  add_index "ci_variables", ["project_id", "key", "environment_scope"], name: "index_ci_variables_on_project_id_and_key_and_environment_scope", unique: true, using: :btree
683

Shinya Maeda's avatar
Shinya Maeda committed
684 685
  create_table "cluster_platforms_kubernetes", force: :cascade do |t|
    t.integer "cluster_id", null: false
686 687
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
Kamil Trzcinski's avatar
Kamil Trzcinski committed
688
    t.text "api_url"
Shinya Maeda's avatar
Shinya Maeda committed
689 690 691 692 693 694 695 696 697 698 699 700 701 702
    t.text "ca_cert"
    t.string "namespace"
    t.string "username"
    t.text "encrypted_password"
    t.string "encrypted_password_iv"
    t.text "encrypted_token"
    t.string "encrypted_token_iv"
  end

  add_index "cluster_platforms_kubernetes", ["cluster_id"], name: "index_cluster_platforms_kubernetes_on_cluster_id", unique: true, using: :btree

  create_table "cluster_projects", force: :cascade do |t|
    t.integer "project_id", null: false
    t.integer "cluster_id", null: false
703 704
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
Shinya Maeda's avatar
Shinya Maeda committed
705 706 707 708 709 710 711 712
  end

  add_index "cluster_projects", ["cluster_id"], name: "index_cluster_projects_on_cluster_id", using: :btree
  add_index "cluster_projects", ["project_id"], name: "index_cluster_projects_on_project_id", using: :btree

  create_table "cluster_providers_gcp", force: :cascade do |t|
    t.integer "cluster_id", null: false
    t.integer "status"
Kamil Trzcinski's avatar
Kamil Trzcinski committed
713
    t.integer "num_nodes", null: false
714 715
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
Shinya Maeda's avatar
Shinya Maeda committed
716 717 718 719 720 721 722 723 724 725 726 727 728
    t.text "status_reason"
    t.string "gcp_project_id", null: false
    t.string "zone", null: false
    t.string "machine_type"
    t.string "operation_id"
    t.string "endpoint"
    t.text "encrypted_access_token"
    t.string "encrypted_access_token_iv"
  end

  add_index "cluster_providers_gcp", ["cluster_id"], name: "index_cluster_providers_gcp_on_cluster_id", unique: true, using: :btree

  create_table "clusters", force: :cascade do |t|
729
    t.integer "user_id"
Kamil Trzcinski's avatar
Kamil Trzcinski committed
730 731
    t.integer "provider_type"
    t.integer "platform_type"
732 733
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
734 735
    t.boolean "enabled", default: true
    t.string "name", null: false
736
    t.string "environment_scope", default: "*", null: false
Shinya Maeda's avatar
Shinya Maeda committed
737 738
  end

Alessio Caiazza's avatar
Alessio Caiazza committed
739 740 741
  add_index "clusters", ["enabled"], name: "index_clusters_on_enabled", using: :btree
  add_index "clusters", ["user_id"], name: "index_clusters_on_user_id", using: :btree

742 743
  create_table "clusters_applications_helm", force: :cascade do |t|
    t.integer "cluster_id", null: false
744 745
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
746 747 748 749
    t.integer "status", null: false
    t.string "version", null: false
    t.text "status_reason"
  end
750

Kamil Trzcinski's avatar
Kamil Trzcinski committed
751 752
  create_table "clusters_applications_ingress", force: :cascade do |t|
    t.integer "cluster_id", null: false
753 754
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
Kamil Trzcinski's avatar
Kamil Trzcinski committed
755 756 757 758 759
    t.integer "status", null: false
    t.integer "ingress_type", null: false
    t.string "version", null: false
    t.string "cluster_ip"
    t.text "status_reason"
760
    t.string "external_ip"
Kamil Trzcinski's avatar
Kamil Trzcinski committed
761 762
  end

763
  create_table "clusters_applications_jupyter", force: :cascade do |t|
764
    t.integer "cluster_id", null: false
765
    t.integer "oauth_application_id"
766 767 768 769 770
    t.integer "status", null: false
    t.string "version", null: false
    t.string "hostname"
    t.datetime_with_timezone "created_at", null: false
    t.datetime_with_timezone "updated_at", null: false
771
    t.text "status_reason"
772 773
  end

774 775 776 777 778 779 780 781 782
  create_table "clusters_applications_prometheus", force: :cascade do |t|
    t.integer "cluster_id", null: false
    t.integer "status", null: false
    t.string "version", null: false
    t.text "status_reason"
    t.datetime_with_timezone "created_at", null: false
    t.datetime_with_timezone "updated_at", null: false
  end

783 784 785 786 787 788 789 790
  create_table "clusters_applications_runners", force: :cascade do |t|
    t.integer "cluster_id", null: false
    t.integer "runner_id"
    t.integer "status", null: false
    t.datetime_with_timezone "created_at", null: false
    t.datetime_with_timezone "updated_at", null: false
    t.string "version", null: false
    t.text "status_reason"
791
    t.boolean "privileged", default: true, null: false
792 793 794 795 796
  end

  add_index "clusters_applications_runners", ["cluster_id"], name: "index_clusters_applications_runners_on_cluster_id", unique: true, using: :btree
  add_index "clusters_applications_runners", ["runner_id"], name: "index_clusters_applications_runners_on_runner_id", using: :btree

797 798 799 800 801 802 803 804 805 806
  create_table "container_repositories", force: :cascade do |t|
    t.integer "project_id", null: false
    t.string "name", null: false
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
  end

  add_index "container_repositories", ["project_id", "name"], name: "index_container_repositories_on_project_id_and_name", unique: true, using: :btree
  add_index "container_repositories", ["project_id"], name: "index_container_repositories_on_project_id", using: :btree

807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829
  create_table "conversational_development_index_metrics", force: :cascade do |t|
    t.float "leader_issues", null: false
    t.float "instance_issues", null: false
    t.float "leader_notes", null: false
    t.float "instance_notes", null: false
    t.float "leader_milestones", null: false
    t.float "instance_milestones", null: false
    t.float "leader_boards", null: false
    t.float "instance_boards", null: false
    t.float "leader_merge_requests", null: false
    t.float "instance_merge_requests", null: false
    t.float "leader_ci_pipelines", null: false
    t.float "instance_ci_pipelines", null: false
    t.float "leader_environments", null: false
    t.float "instance_environments", null: false
    t.float "leader_deployments", null: false
    t.float "instance_deployments", null: false
    t.float "leader_projects_prometheus_active", null: false
    t.float "instance_projects_prometheus_active", null: false
    t.float "leader_service_desk_issues", null: false
    t.float "instance_service_desk_issues", null: false
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
830 831 832 833 834 835 836 837 838 839
    t.float "percentage_boards", default: 0.0, null: false
    t.float "percentage_ci_pipelines", default: 0.0, null: false
    t.float "percentage_deployments", default: 0.0, null: false
    t.float "percentage_environments", default: 0.0, null: false
    t.float "percentage_issues", default: 0.0, null: false
    t.float "percentage_merge_requests", default: 0.0, null: false
    t.float "percentage_milestones", default: 0.0, null: false
    t.float "percentage_notes", default: 0.0, null: false
    t.float "percentage_projects_prometheus_active", default: 0.0, null: false
    t.float "percentage_service_desk_issues", default: 0.0, null: false
840 841
  end

Valery Sizov's avatar
Valery Sizov committed
842
  create_table "deploy_keys_projects", force: :cascade do |t|
843 844
    t.integer "deploy_key_id", null: false
    t.integer "project_id", null: false
Kamil Trzcinski's avatar
Kamil Trzcinski committed
845 846
    t.datetime "created_at"
    t.datetime "updated_at"
847
    t.boolean "can_push", default: false, null: false
848
  end
849

Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
850
  add_index "deploy_keys_projects", ["project_id"], name: "index_deploy_keys_projects_on_project_id", using: :btree
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
851

852 853
  create_table "deploy_tokens", force: :cascade do |t|
    t.boolean "revoked", default: false
854 855
    t.boolean "read_repository", default: false, null: false
    t.boolean "read_registry", default: false, null: false
856
    t.datetime_with_timezone "expires_at", null: false
857
    t.datetime_with_timezone "created_at", null: false
858 859
    t.string "name", null: false
    t.string "token", null: false
860 861
  end

862
  add_index "deploy_tokens", ["token", "expires_at", "id"], name: "index_deploy_tokens_on_token_and_expires_at_and_id", where: "(revoked IS FALSE)", using: :btree
863 864
  add_index "deploy_tokens", ["token"], name: "index_deploy_tokens_on_token", unique: true, using: :btree

865
  create_table "deployments", force: :cascade do |t|
866 867 868 869 870 871 872 873 874
    t.integer "iid", null: false
    t.integer "project_id", null: false
    t.integer "environment_id", null: false
    t.string "ref", null: false
    t.boolean "tag", null: false
    t.string "sha", null: false
    t.integer "user_id"
    t.integer "deployable_id"
    t.string "deployable_type"
875 876
    t.datetime "created_at"
    t.datetime "updated_at"
877
    t.string "on_stop"
878 879
  end

880
  add_index "deployments", ["created_at"], name: "index_deployments_on_created_at", using: :btree
881
  add_index "deployments", ["deployable_type", "deployable_id"], name: "index_deployments_on_deployable_type_and_deployable_id", using: :btree
882 883
  add_index "deployments", ["environment_id", "id"], name: "index_deployments_on_environment_id_and_id", using: :btree
  add_index "deployments", ["environment_id", "iid", "project_id"], name: "index_deployments_on_environment_id_and_iid_and_project_id", using: :btree
884
  add_index "deployments", ["project_id", "iid"], name: "index_deployments_on_project_id_and_iid", unique: true, using: :btree
885

Valery Sizov's avatar
Valery Sizov committed
886
  create_table "emails", force: :cascade do |t|
887 888
    t.integer "user_id", null: false
    t.string "email", null: false
889 890
    t.datetime "created_at"
    t.datetime "updated_at"
891
    t.string "confirmation_token"
892 893
    t.datetime_with_timezone "confirmed_at"
    t.datetime_with_timezone "confirmation_sent_at"
894 895
  end

896
  add_index "emails", ["confirmation_token"], name: "index_emails_on_confirmation_token", unique: true, using: :btree
Kamil Trzcinski's avatar
Kamil Trzcinski committed
897
  add_index "emails", ["email"], name: "index_emails_on_email", unique: true, using: :btree
898 899
  add_index "emails", ["user_id"], name: "index_emails_on_user_id", using: :btree

900
  create_table "environments", force: :cascade do |t|
901
    t.integer "project_id", null: false
902
    t.string "name", null: false
903 904
    t.datetime "created_at"
    t.datetime "updated_at"
905 906
    t.string "external_url"
    t.string "environment_type"
907
    t.string "state", default: "available", null: false
Nick Thomas's avatar
Nick Thomas committed
908
    t.string "slug", null: false
909 910
  end

911
  add_index "environments", ["project_id", "name"], name: "index_environments_on_project_id_and_name", unique: true, using: :btree
Nick Thomas's avatar
Nick Thomas committed
912
  add_index "environments", ["project_id", "slug"], name: "index_environments_on_project_id_and_slug", unique: true, using: :btree
913

914 915 916
  create_table "epic_issues", force: :cascade do |t|
    t.integer "epic_id", null: false
    t.integer "issue_id", null: false
917
    t.integer "relative_position", default: 1073741823, null: false
918 919 920 921 922
  end

  add_index "epic_issues", ["epic_id"], name: "index_epic_issues_on_epic_id", using: :btree
  add_index "epic_issues", ["issue_id"], name: "index_epic_issues_on_issue_id", unique: true, using: :btree

Clement Ho's avatar
Clement Ho committed
923 924
  create_table "epic_metrics", force: :cascade do |t|
    t.integer "epic_id", null: false
925 926
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
Clement Ho's avatar
Clement Ho committed
927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942
  end

  add_index "epic_metrics", ["epic_id"], name: "index_epic_metrics", using: :btree

  create_table "epics", force: :cascade do |t|
    t.integer "milestone_id"
    t.integer "group_id", null: false
    t.integer "author_id", null: false
    t.integer "assignee_id"
    t.integer "iid", null: false
    t.integer "cached_markdown_version"
    t.integer "updated_by_id"
    t.integer "last_edited_by_id"
    t.integer "lock_version"
    t.date "start_date"
    t.date "end_date"
943 944 945
    t.datetime "last_edited_at"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
Clement Ho's avatar
Clement Ho committed
946 947 948 949 950 951 952 953
    t.string "title", null: false
    t.string "title_html", null: false
    t.text "description"
    t.text "description_html"
  end

  add_index "epics", ["assignee_id"], name: "index_epics_on_assignee_id", using: :btree
  add_index "epics", ["author_id"], name: "index_epics_on_author_id", using: :btree
954
  add_index "epics", ["end_date"], name: "index_epics_on_end_date", using: :btree
Clement Ho's avatar
Clement Ho committed
955 956 957
  add_index "epics", ["group_id"], name: "index_epics_on_group_id", using: :btree
  add_index "epics", ["iid"], name: "index_epics_on_iid", using: :btree
  add_index "epics", ["milestone_id"], name: "index_milestone", using: :btree
958
  add_index "epics", ["start_date"], name: "index_epics_on_start_date", using: :btree
Clement Ho's avatar
Clement Ho committed
959

Valery Sizov's avatar
Valery Sizov committed
960
  create_table "events", force: :cascade do |t|
961 962 963
    t.integer "project_id"
    t.integer "author_id", null: false
    t.integer "target_id"
964 965
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
966 967 968 969
    t.integer "action", limit: 2, null: false
    t.string "target_type"
  end

970
  add_index "events", ["action"], name: "index_events_on_action", using: :btree
971
  add_index "events", ["author_id", "project_id"], name: "index_events_on_author_id_and_project_id", using: :btree
972 973
  add_index "events", ["project_id", "id"], name: "index_events_on_project_id_and_id", using: :btree
  add_index "events", ["target_type", "target_id"], name: "index_events_on_target_type_and_target_id", using: :btree
974

975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992
  create_table "feature_gates", force: :cascade do |t|
    t.string "feature_key", null: false
    t.string "key", null: false
    t.string "value"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
  end

  add_index "feature_gates", ["feature_key", "key", "value"], name: "index_feature_gates_on_feature_key_and_key_and_value", unique: true, using: :btree

  create_table "features", force: :cascade do |t|
    t.string "key", null: false
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
  end

  add_index "features", ["key"], name: "index_features_on_key", unique: true, using: :btree

993 994 995 996 997 998 999 1000 1001
  create_table "fork_network_members", force: :cascade do |t|
    t.integer "fork_network_id", null: false
    t.integer "project_id", null: false
    t.integer "forked_from_project_id"
  end

  add_index "fork_network_members", ["fork_network_id"], name: "index_fork_network_members_on_fork_network_id", using: :btree
  add_index "fork_network_members", ["project_id"], name: "index_fork_network_members_on_project_id", unique: true, using: :btree

1002 1003 1004 1005 1006 1007 1008
  create_table "fork_networks", force: :cascade do |t|
    t.integer "root_project_id"
    t.string "deleted_root_project_name"
  end

  add_index "fork_networks", ["root_project_id"], name: "index_fork_networks_on_root_project_id", unique: true, using: :btree

Valery Sizov's avatar
Valery Sizov committed
1009
  create_table "forked_project_links", force: :cascade do |t|
1010 1011
    t.integer "forked_to_project_id", null: false
    t.integer "forked_from_project_id", null: false
Kamil Trzcinski's avatar
Kamil Trzcinski committed
1012 1013
    t.datetime "created_at"
    t.datetime "updated_at"
1014 1015
  end

Kamil Trzcinski's avatar
Kamil Trzcinski committed
1016
  add_index "forked_project_links", ["forked_to_project_id"], name: "index_forked_project_links_on_forked_to_project_id", unique: true, using: :btree
1017

1018 1019 1020 1021 1022 1023
  create_table "gcp_clusters", force: :cascade do |t|
    t.integer "project_id", null: false
    t.integer "user_id"
    t.integer "service_id"
    t.integer "status"
    t.integer "gcp_cluster_size", null: false
1024 1025
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046
    t.boolean "enabled", default: true
    t.text "status_reason"
    t.string "project_namespace"
    t.string "endpoint"
    t.text "ca_cert"
    t.text "encrypted_kubernetes_token"
    t.string "encrypted_kubernetes_token_iv"
    t.string "username"
    t.text "encrypted_password"
    t.string "encrypted_password_iv"
    t.string "gcp_project_id", null: false
    t.string "gcp_cluster_zone", null: false
    t.string "gcp_cluster_name", null: false
    t.string "gcp_machine_type"
    t.string "gcp_operation_id"
    t.text "encrypted_gcp_token"
    t.string "encrypted_gcp_token_iv"
  end

  add_index "gcp_clusters", ["project_id"], name: "index_gcp_clusters_on_project_id", unique: true, using: :btree

1047
  create_table "geo_event_log", id: :bigserial, force: :cascade do |t|
1048
    t.datetime "created_at", null: false
1049
    t.integer "repository_updated_event_id", limit: 8
Stan Hu's avatar
Stan Hu committed
1050
    t.integer "repository_deleted_event_id", limit: 8
1051
    t.integer "repository_renamed_event_id", limit: 8
1052
    t.integer "repositories_changed_event_id", limit: 8
1053
    t.integer "repository_created_event_id", limit: 8
1054
    t.integer "hashed_storage_migrated_event_id", limit: 8
1055
    t.integer "lfs_object_deleted_event_id", limit: 8
1056
    t.integer "hashed_storage_attachments_event_id", limit: 8
1057
    t.integer "job_artifact_deleted_event_id", limit: 8
1058
    t.integer "upload_deleted_event_id", limit: 8
1059 1060
  end

1061
  add_index "geo_event_log", ["repositories_changed_event_id"], name: "index_geo_event_log_on_repositories_changed_event_id", using: :btree
1062
  add_index "geo_event_log", ["repository_created_event_id"], name: "index_geo_event_log_on_repository_created_event_id", using: :btree
1063 1064
  add_index "geo_event_log", ["repository_deleted_event_id"], name: "index_geo_event_log_on_repository_deleted_event_id", using: :btree
  add_index "geo_event_log", ["repository_renamed_event_id"], name: "index_geo_event_log_on_repository_renamed_event_id", using: :btree
1065
  add_index "geo_event_log", ["repository_updated_event_id"], name: "index_geo_event_log_on_repository_updated_event_id", using: :btree
1066

1067 1068 1069 1070 1071 1072 1073 1074
  create_table "geo_hashed_storage_attachments_events", id: :bigserial, force: :cascade do |t|
    t.integer "project_id", null: false
    t.text "old_attachments_path", null: false
    t.text "new_attachments_path", null: false
  end

  add_index "geo_hashed_storage_attachments_events", ["project_id"], name: "index_geo_hashed_storage_attachments_events_on_project_id", using: :btree

1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087
  create_table "geo_hashed_storage_migrated_events", id: :bigserial, force: :cascade do |t|
    t.integer "project_id", null: false
    t.text "repository_storage_name", null: false
    t.text "old_disk_path", null: false
    t.text "new_disk_path", null: false
    t.text "old_wiki_disk_path", null: false
    t.text "new_wiki_disk_path", null: false
    t.integer "old_storage_version", limit: 2
    t.integer "new_storage_version", limit: 2, null: false
  end

  add_index "geo_hashed_storage_migrated_events", ["project_id"], name: "index_geo_hashed_storage_migrated_events_on_project_id", using: :btree

1088 1089 1090 1091 1092 1093 1094
  create_table "geo_job_artifact_deleted_events", id: :bigserial, force: :cascade do |t|
    t.integer "job_artifact_id", null: false
    t.string "file_path", null: false
  end

  add_index "geo_job_artifact_deleted_events", ["job_artifact_id"], name: "index_geo_job_artifact_deleted_events_on_job_artifact_id", using: :btree

1095 1096 1097 1098 1099 1100 1101 1102
  create_table "geo_lfs_object_deleted_events", id: :bigserial, force: :cascade do |t|
    t.integer "lfs_object_id", null: false
    t.string "oid", null: false
    t.string "file_path", null: false
  end

  add_index "geo_lfs_object_deleted_events", ["lfs_object_id"], name: "index_geo_lfs_object_deleted_events_on_lfs_object_id", using: :btree

1103
  create_table "geo_node_namespace_links", force: :cascade do |t|
1104
    t.integer "geo_node_id", null: false
1105
    t.integer "namespace_id", null: false
1106 1107
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
1108 1109
  end

1110 1111
  add_index "geo_node_namespace_links", ["geo_node_id", "namespace_id"], name: "index_geo_node_namespace_links_on_geo_node_id_and_namespace_id", unique: true, using: :btree
  add_index "geo_node_namespace_links", ["geo_node_id"], name: "index_geo_node_namespace_links_on_geo_node_id", using: :btree
1112

1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125
  create_table "geo_node_statuses", force: :cascade do |t|
    t.integer "geo_node_id", null: false
    t.integer "db_replication_lag_seconds"
    t.integer "repositories_count"
    t.integer "repositories_synced_count"
    t.integer "repositories_failed_count"
    t.integer "lfs_objects_count"
    t.integer "lfs_objects_synced_count"
    t.integer "lfs_objects_failed_count"
    t.integer "attachments_count"
    t.integer "attachments_synced_count"
    t.integer "attachments_failed_count"
    t.integer "last_event_id"
1126
    t.datetime "last_event_date"
1127
    t.integer "cursor_last_event_id"
1128 1129 1130 1131
    t.datetime "cursor_last_event_date"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
    t.datetime "last_successful_status_check_at"
1132
    t.string "status_message"
1133 1134
    t.integer "replication_slots_count"
    t.integer "replication_slots_used_count"
1135
    t.integer "replication_slots_max_retained_wal_bytes", limit: 8
1136 1137 1138
    t.integer "wikis_count"
    t.integer "wikis_synced_count"
    t.integer "wikis_failed_count"
1139 1140 1141
    t.integer "job_artifacts_count"
    t.integer "job_artifacts_synced_count"
    t.integer "job_artifacts_failed_count"
1142 1143
    t.string "version"
    t.string "revision"
1144 1145 1146 1147
    t.integer "repositories_verified_count"
    t.integer "repositories_verification_failed_count"
    t.integer "wikis_verified_count"
    t.integer "wikis_verification_failed_count"
1148 1149 1150
    t.integer "lfs_objects_synced_missing_on_primary_count"
    t.integer "job_artifacts_synced_missing_on_primary_count"
    t.integer "attachments_synced_missing_on_primary_count"
1151 1152 1153 1154 1155 1156
    t.integer "repositories_checksummed_count"
    t.integer "repositories_checksum_failed_count"
    t.integer "repositories_checksum_mismatch_count"
    t.integer "wikis_checksummed_count"
    t.integer "wikis_checksum_failed_count"
    t.integer "wikis_checksum_mismatch_count"
1157 1158 1159 1160
  end

  add_index "geo_node_statuses", ["geo_node_id"], name: "index_geo_node_statuses_on_geo_node_id", unique: true, using: :btree

1161 1162
  create_table "geo_nodes", force: :cascade do |t|
    t.boolean "primary"
1163
    t.integer "oauth_application_id"
1164
    t.boolean "enabled", default: true, null: false
1165 1166 1167
    t.string "access_key"
    t.string "encrypted_secret_access_key"
    t.string "encrypted_secret_access_key_iv"
1168
    t.string "clone_url_prefix"
1169 1170
    t.integer "files_max_capacity", default: 10, null: false
    t.integer "repos_max_capacity", default: 25, null: false
1171
    t.string "url", null: false
1172 1173
    t.string "selective_sync_type"
    t.text "selective_sync_shards"
1174
    t.integer "verification_max_capacity", default: 100, null: false
1175 1176
  end

1177
  add_index "geo_nodes", ["access_key"], name: "index_geo_nodes_on_access_key", using: :btree
1178
  add_index "geo_nodes", ["primary"], name: "index_geo_nodes_on_primary", using: :btree
1179
  add_index "geo_nodes", ["url"], name: "index_geo_nodes_on_url", unique: true, using: :btree
Valery Sizov's avatar
Valery Sizov committed
1180

1181 1182 1183 1184 1185 1186
  create_table "geo_repositories_changed_events", id: :bigserial, force: :cascade do |t|
    t.integer "geo_node_id", null: false
  end

  add_index "geo_repositories_changed_events", ["geo_node_id"], name: "index_geo_repositories_changed_events_on_geo_node_id", using: :btree

1187 1188 1189 1190 1191 1192 1193 1194 1195 1196
  create_table "geo_repository_created_events", id: :bigserial, force: :cascade do |t|
    t.integer "project_id", null: false
    t.text "repository_storage_name", null: false
    t.text "repo_path", null: false
    t.text "wiki_path"
    t.text "project_name", null: false
  end

  add_index "geo_repository_created_events", ["project_id"], name: "index_geo_repository_created_events_on_project_id", using: :btree

Stan Hu's avatar
Stan Hu committed
1197 1198
  create_table "geo_repository_deleted_events", id: :bigserial, force: :cascade do |t|
    t.integer "project_id", null: false
1199
    t.text "repository_storage_name", null: false
Stan Hu's avatar
Stan Hu committed
1200 1201 1202 1203 1204 1205 1206
    t.text "deleted_path", null: false
    t.text "deleted_wiki_path"
    t.text "deleted_project_name", null: false
  end

  add_index "geo_repository_deleted_events", ["project_id"], name: "index_geo_repository_deleted_events_on_project_id", using: :btree

1207 1208 1209
  create_table "geo_repository_renamed_events", id: :bigserial, force: :cascade do |t|
    t.integer "project_id", null: false
    t.text "repository_storage_name", null: false
1210 1211
    t.text "old_path_with_namespace", null: false
    t.text "new_path_with_namespace", null: false
1212 1213
    t.text "old_wiki_path_with_namespace", null: false
    t.text "new_wiki_path_with_namespace", null: false
1214 1215
    t.text "old_path", null: false
    t.text "new_path", null: false
1216 1217 1218 1219
  end

  add_index "geo_repository_renamed_events", ["project_id"], name: "index_geo_repository_renamed_events_on_project_id", using: :btree

1220
  create_table "geo_repository_updated_events", id: :bigserial, force: :cascade do |t|
1221 1222
    t.integer "branches_affected", null: false
    t.integer "tags_affected", null: false
1223
    t.integer "project_id", null: false
1224
    t.integer "source", limit: 2, null: false
1225 1226
    t.boolean "new_branch", default: false, null: false
    t.boolean "remove_branch", default: false, null: false
1227
    t.text "ref"
1228 1229
  end

1230 1231
  add_index "geo_repository_updated_events", ["project_id"], name: "index_geo_repository_updated_events_on_project_id", using: :btree
  add_index "geo_repository_updated_events", ["source"], name: "index_geo_repository_updated_events_on_source", using: :btree
1232

1233 1234 1235 1236 1237 1238 1239 1240 1241 1242
  create_table "geo_upload_deleted_events", id: :bigserial, force: :cascade do |t|
    t.integer "upload_id", null: false
    t.string "file_path", null: false
    t.integer "model_id", null: false
    t.string "model_type", null: false
    t.string "uploader", null: false
  end

  add_index "geo_upload_deleted_events", ["upload_id"], name: "index_geo_upload_deleted_events_on_upload_id", using: :btree

1243
  create_table "gpg_key_subkeys", force: :cascade do |t|
1244
    t.integer "gpg_key_id", null: false
1245 1246 1247 1248
    t.binary "keyid"
    t.binary "fingerprint"
  end

1249
  add_index "gpg_key_subkeys", ["fingerprint"], name: "index_gpg_key_subkeys_on_fingerprint", unique: true, using: :btree
1250
  add_index "gpg_key_subkeys", ["gpg_key_id"], name: "index_gpg_key_subkeys_on_gpg_key_id", using: :btree
1251
  add_index "gpg_key_subkeys", ["keyid"], name: "index_gpg_key_subkeys_on_keyid", unique: true, using: :btree
1252

Alexis Reigel's avatar
Alexis Reigel committed
1253
  create_table "gpg_keys", force: :cascade do |t|
1254 1255
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
1256
    t.integer "user_id"
1257 1258
    t.binary "primary_keyid"
    t.binary "fingerprint"
1259
    t.text "key"
Alexis Reigel's avatar
Alexis Reigel committed
1260 1261
  end

1262 1263
  add_index "gpg_keys", ["fingerprint"], name: "index_gpg_keys_on_fingerprint", unique: true, using: :btree
  add_index "gpg_keys", ["primary_keyid"], name: "index_gpg_keys_on_primary_keyid", unique: true, using: :btree
Alexis Reigel's avatar
Alexis Reigel committed
1264 1265
  add_index "gpg_keys", ["user_id"], name: "index_gpg_keys_on_user_id", using: :btree

1266
  create_table "gpg_signatures", force: :cascade do |t|
1267 1268
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
1269 1270
    t.integer "project_id"
    t.integer "gpg_key_id"
1271 1272
    t.binary "commit_sha"
    t.binary "gpg_key_primary_keyid"
1273 1274
    t.text "gpg_key_user_name"
    t.text "gpg_key_user_email"
1275
    t.integer "verification_status", limit: 2, default: 0, null: false
1276
    t.integer "gpg_key_subkey_id"
1277 1278
  end

1279
  add_index "gpg_signatures", ["commit_sha"], name: "index_gpg_signatures_on_commit_sha", unique: true, using: :btree
1280 1281
  add_index "gpg_signatures", ["gpg_key_id"], name: "index_gpg_signatures_on_gpg_key_id", using: :btree
  add_index "gpg_signatures", ["gpg_key_primary_keyid"], name: "index_gpg_signatures_on_gpg_key_primary_keyid", using: :btree
1282
  add_index "gpg_signatures", ["gpg_key_subkey_id"], name: "index_gpg_signatures_on_gpg_key_subkey_id", using: :btree
1283
  add_index "gpg_signatures", ["project_id"], name: "index_gpg_signatures_on_project_id", using: :btree
Valery Sizov's avatar
Valery Sizov committed
1284

1285
  create_table "group_custom_attributes", force: :cascade do |t|
1286 1287
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
1288 1289 1290 1291 1292 1293 1294 1295
    t.integer "group_id", null: false
    t.string "key", null: false
    t.string "value", null: false
  end

  add_index "group_custom_attributes", ["group_id", "key"], name: "index_group_custom_attributes_on_group_id_and_key", unique: true, using: :btree
  add_index "group_custom_attributes", ["key", "value"], name: "index_group_custom_attributes_on_key_and_value", using: :btree

1296 1297 1298 1299 1300 1301 1302
  create_table "historical_data", force: :cascade do |t|
    t.date "date", null: false
    t.integer "active_user_count"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

Valery Sizov's avatar
Valery Sizov committed
1303
  create_table "identities", force: :cascade do |t|
1304 1305 1306
    t.string "extern_uid"
    t.string "provider"
    t.integer "user_id"
1307 1308
    t.datetime "created_at"
    t.datetime "updated_at"
1309
    t.string "secondary_extern_uid"
1310
    t.integer "saml_provider_id"
1311 1312
  end

1313
  add_index "identities", ["saml_provider_id"], name: "index_identities_on_saml_provider_id", where: "(saml_provider_id IS NOT NULL)", using: :btree
1314 1315
  add_index "identities", ["user_id"], name: "index_identities_on_user_id", using: :btree

1316 1317 1318 1319 1320 1321 1322 1323 1324 1325
  create_table "import_export_uploads", force: :cascade do |t|
    t.datetime_with_timezone "updated_at", null: false
    t.integer "project_id"
    t.text "import_file"
    t.text "export_file"
  end

  add_index "import_export_uploads", ["project_id"], name: "index_import_export_uploads_on_project_id", using: :btree
  add_index "import_export_uploads", ["updated_at"], name: "index_import_export_uploads_on_updated_at", using: :btree

Valery Sizov's avatar
Valery Sizov committed
1326
  create_table "index_statuses", force: :cascade do |t|
1327
    t.integer "project_id", null: false
Valery Sizov's avatar
Valery Sizov committed
1328
    t.datetime "indexed_at"
1329 1330 1331 1332
    t.text "note"
    t.string "last_commit"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
Valery Sizov's avatar
Valery Sizov committed
1333 1334
  end

Valery Sizov's avatar
Valery Sizov committed
1335
  add_index "index_statuses", ["project_id"], name: "index_index_statuses_on_project_id", unique: true, using: :btree
Valery Sizov's avatar
Valery Sizov committed
1336

1337
  create_table "internal_ids", id: :bigserial, force: :cascade do |t|
1338
    t.integer "project_id"
1339 1340
    t.integer "usage", null: false
    t.integer "last_value", null: false
1341
    t.integer "namespace_id"
1342 1343
  end

1344 1345
  add_index "internal_ids", ["usage", "namespace_id"], name: "index_internal_ids_on_usage_and_namespace_id", unique: true, where: "(namespace_id IS NOT NULL)", using: :btree
  add_index "internal_ids", ["usage", "project_id"], name: "index_internal_ids_on_usage_and_project_id", unique: true, where: "(project_id IS NOT NULL)", using: :btree
1346

1347
  create_table "issue_assignees", id: false, force: :cascade do |t|
1348 1349 1350 1351 1352 1353 1354
    t.integer "user_id", null: false
    t.integer "issue_id", null: false
  end

  add_index "issue_assignees", ["issue_id", "user_id"], name: "index_issue_assignees_on_issue_id_and_user_id", unique: true, using: :btree
  add_index "issue_assignees", ["user_id"], name: "index_issue_assignees_on_user_id", using: :btree

1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365
  create_table "issue_links", force: :cascade do |t|
    t.integer "source_id", null: false
    t.integer "target_id", null: false
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "issue_links", ["source_id", "target_id"], name: "index_issue_links_on_source_id_and_target_id", unique: true, using: :btree
  add_index "issue_links", ["source_id"], name: "index_issue_links_on_source_id", using: :btree
  add_index "issue_links", ["target_id"], name: "index_issue_links_on_target_id", using: :btree

1366
  create_table "issue_metrics", force: :cascade do |t|
1367
    t.integer "issue_id", null: false
1368
    t.datetime "first_mentioned_in_commit_at"
1369 1370
    t.datetime "first_associated_with_milestone_at"
    t.datetime "first_added_to_board_at"
1371 1372
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
1373 1374 1375 1376
  end

  add_index "issue_metrics", ["issue_id"], name: "index_issue_metrics", using: :btree

Valery Sizov's avatar
Valery Sizov committed
1377
  create_table "issues", force: :cascade do |t|
1378 1379 1380
    t.string "title"
    t.integer "author_id"
    t.integer "project_id"
1381 1382
    t.datetime "created_at"
    t.datetime "updated_at"
1383 1384 1385 1386 1387 1388
    t.text "description"
    t.integer "milestone_id"
    t.string "state"
    t.integer "iid"
    t.integer "updated_by_id"
    t.integer "weight"
1389
    t.boolean "confidential", default: false, null: false
1390 1391 1392 1393 1394
    t.date "due_date"
    t.integer "moved_to_id"
    t.integer "lock_version"
    t.text "title_html"
    t.text "description_html"
1395
    t.integer "time_estimate"
1396
    t.integer "relative_position"
1397
    t.string "service_desk_reply_to"
1398
    t.integer "cached_markdown_version"
1399 1400
    t.datetime "last_edited_at"
    t.integer "last_edited_by_id"
1401
    t.boolean "discussion_locked"
1402
    t.datetime_with_timezone "closed_at"
haseeb's avatar
haseeb committed
1403
    t.integer "closed_by_id"
Andrew8xx8's avatar
Andrew8xx8 committed
1404 1405
  end

Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
1406
  add_index "issues", ["author_id"], name: "index_issues_on_author_id", using: :btree
1407
  add_index "issues", ["confidential"], name: "index_issues_on_confidential", using: :btree
1408
  add_index "issues", ["description"], name: "index_issues_on_description_trigram", using: :gin, opclasses: {"description"=>"gin_trgm_ops"}
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
1409
  add_index "issues", ["milestone_id"], name: "index_issues_on_milestone_id", using: :btree
1410
  add_index "issues", ["moved_to_id"], name: "index_issues_on_moved_to_id", where: "(moved_to_id IS NOT NULL)", using: :btree
1411
  add_index "issues", ["project_id", "created_at", "id", "state"], name: "index_issues_on_project_id_and_created_at_and_id_and_state", using: :btree
1412
  add_index "issues", ["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)", using: :btree
1413
  add_index "issues", ["project_id", "iid"], name: "index_issues_on_project_id_and_iid", unique: true, using: :btree
1414
  add_index "issues", ["project_id", "updated_at", "id", "state"], name: "index_issues_on_project_id_and_updated_at_and_id_and_state", using: :btree
1415
  add_index "issues", ["relative_position"], name: "index_issues_on_relative_position", using: :btree
1416
  add_index "issues", ["state"], name: "index_issues_on_state", using: :btree
1417
  add_index "issues", ["title"], name: "index_issues_on_title_trigram", using: :gin, opclasses: {"title"=>"gin_trgm_ops"}
1418
  add_index "issues", ["updated_at"], name: "index_issues_on_updated_at", using: :btree
1419
  add_index "issues", ["updated_by_id"], name: "index_issues_on_updated_by_id", where: "(updated_by_id IS NOT NULL)", using: :btree
Andrew8xx8's avatar
Andrew8xx8 committed
1420

Valery Sizov's avatar
Valery Sizov committed
1421
  create_table "keys", force: :cascade do |t|
1422
    t.integer "user_id"
1423 1424
    t.datetime "created_at"
    t.datetime "updated_at"
1425 1426 1427 1428 1429
    t.text "key"
    t.string "title"
    t.string "type"
    t.string "fingerprint"
    t.boolean "public", default: false, null: false
1430
    t.datetime "last_used_at"
Andrew8xx8's avatar
Andrew8xx8 committed
1431 1432
  end

1433
  add_index "keys", ["fingerprint"], name: "index_keys_on_fingerprint", unique: true, using: :btree
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
1434
  add_index "keys", ["user_id"], name: "index_keys_on_user_id", using: :btree
Andrew8xx8's avatar
Andrew8xx8 committed
1435

Valery Sizov's avatar
Valery Sizov committed
1436
  create_table "label_links", force: :cascade do |t|
1437 1438 1439
    t.integer "label_id"
    t.integer "target_id"
    t.string "target_type"
1440 1441 1442 1443
    t.datetime "created_at"
    t.datetime "updated_at"
  end

Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
1444 1445 1446
  add_index "label_links", ["label_id"], name: "index_label_links_on_label_id", using: :btree
  add_index "label_links", ["target_id", "target_type"], name: "index_label_links_on_target_id_and_target_type", using: :btree

1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457
  create_table "label_priorities", force: :cascade do |t|
    t.integer "project_id", null: false
    t.integer "label_id", null: false
    t.integer "priority", null: false
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
  end

  add_index "label_priorities", ["priority"], name: "index_label_priorities_on_priority", using: :btree
  add_index "label_priorities", ["project_id", "label_id"], name: "index_label_priorities_on_project_id_and_label_id", unique: true, using: :btree

Valery Sizov's avatar
Valery Sizov committed
1458
  create_table "labels", force: :cascade do |t|
1459 1460 1461
    t.string "title"
    t.string "color"
    t.integer "project_id"
1462 1463
    t.datetime "created_at"
    t.datetime "updated_at"
1464 1465 1466
    t.boolean "template", default: false
    t.string "description"
    t.text "description_html"
1467 1468
    t.string "type"
    t.integer "group_id"
1469
    t.integer "cached_markdown_version"
1470 1471
  end

1472
  add_index "labels", ["group_id", "project_id", "title"], name: "index_labels_on_group_id_and_project_id_and_title", unique: true, using: :btree
1473
  add_index "labels", ["project_id"], name: "index_labels_on_project_id", using: :btree
1474
  add_index "labels", ["template"], name: "index_labels_on_template", where: "template", using: :btree
1475
  add_index "labels", ["title"], name: "index_labels_on_title", using: :btree
1476
  add_index "labels", ["type", "project_id"], name: "index_labels_on_type_and_project_id", using: :btree
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
1477

Valery Sizov's avatar
Valery Sizov committed
1478
  create_table "ldap_group_links", force: :cascade do |t|
1479
    t.string "cn"
1480 1481
    t.integer "group_access", null: false
    t.integer "group_id", null: false
Valery Sizov's avatar
Valery Sizov committed
1482 1483
    t.datetime "created_at"
    t.datetime "updated_at"
1484
    t.string "provider"
1485
    t.string "filter"
Valery Sizov's avatar
Valery Sizov committed
1486 1487
  end

1488 1489 1490 1491
  create_table "lfs_file_locks", force: :cascade do |t|
    t.integer "project_id", null: false
    t.integer "user_id", null: false
    t.datetime "created_at", null: false
1492
    t.string "path", limit: 511
1493 1494
  end

1495
  add_index "lfs_file_locks", ["project_id", "path"], name: "index_lfs_file_locks_on_project_id_and_path", unique: true, using: :btree
1496 1497
  add_index "lfs_file_locks", ["user_id"], name: "index_lfs_file_locks_on_user_id", using: :btree

Valery Sizov's avatar
Valery Sizov committed
1498
  create_table "lfs_objects", force: :cascade do |t|
1499 1500
    t.string "oid", null: false
    t.integer "size", limit: 8, null: false
Marin Jankovski's avatar
Marin Jankovski committed
1501 1502
    t.datetime "created_at"
    t.datetime "updated_at"
1503
    t.string "file"
1504
    t.integer "file_store"
Marin Jankovski's avatar
Marin Jankovski committed
1505 1506
  end

1507
  add_index "lfs_objects", ["oid"], name: "index_lfs_objects_on_oid", unique: true, using: :btree
Marin Jankovski's avatar
Marin Jankovski committed
1508

Valery Sizov's avatar
Valery Sizov committed
1509
  create_table "lfs_objects_projects", force: :cascade do |t|
1510 1511
    t.integer "lfs_object_id", null: false
    t.integer "project_id", null: false
Marin Jankovski's avatar
Marin Jankovski committed
1512 1513 1514 1515 1516 1517
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "lfs_objects_projects", ["project_id"], name: "index_lfs_objects_projects_on_project_id", using: :btree

Valery Sizov's avatar
Valery Sizov committed
1518
  create_table "licenses", force: :cascade do |t|
1519
    t.text "data", null: false
Valery Sizov's avatar
Valery Sizov committed
1520 1521 1522 1523
    t.datetime "created_at"
    t.datetime "updated_at"
  end

1524
  create_table "lists", force: :cascade do |t|
1525 1526 1527 1528 1529 1530
    t.integer "board_id", null: false
    t.integer "label_id"
    t.integer "list_type", default: 1, null: false
    t.integer "position"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
1531
    t.integer "user_id"
1532 1533
  end

1534
  add_index "lists", ["board_id", "label_id"], name: "index_lists_on_board_id_and_label_id", unique: true, using: :btree
1535
  add_index "lists", ["label_id"], name: "index_lists_on_label_id", using: :btree
1536
  add_index "lists", ["user_id"], name: "index_lists_on_user_id", using: :btree
1537

Valery Sizov's avatar
Valery Sizov committed
1538
  create_table "members", force: :cascade do |t|
1539 1540 1541 1542 1543 1544
    t.integer "access_level", null: false
    t.integer "source_id", null: false
    t.string "source_type", null: false
    t.integer "user_id"
    t.integer "notification_level", null: false
    t.string "type"
1545 1546
    t.datetime "created_at"
    t.datetime "updated_at"
1547 1548 1549
    t.integer "created_by_id"
    t.string "invite_email"
    t.string "invite_token"
Douwe Maan's avatar
Douwe Maan committed
1550
    t.datetime "invite_accepted_at"
1551
    t.datetime "requested_at"
1552 1553 1554
    t.date "expires_at"
    t.boolean "ldap", default: false, null: false
    t.boolean "override", default: false, null: false
1555 1556
  end

1557
  add_index "members", ["access_level"], name: "index_members_on_access_level", using: :btree
Douwe Maan's avatar
Douwe Maan committed
1558
  add_index "members", ["invite_token"], name: "index_members_on_invite_token", unique: true, using: :btree
1559
  add_index "members", ["requested_at"], name: "index_members_on_requested_at", using: :btree
1560 1561 1562
  add_index "members", ["source_id", "source_type"], name: "index_members_on_source_id_and_source_type", using: :btree
  add_index "members", ["user_id"], name: "index_members_on_user_id", using: :btree

1563
  create_table "merge_request_diff_commits", id: false, force: :cascade do |t|
1564 1565
    t.datetime "authored_date"
    t.datetime "committed_date"
1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576
    t.integer "merge_request_diff_id", null: false
    t.integer "relative_order", null: false
    t.binary "sha", null: false
    t.text "author_name"
    t.text "author_email"
    t.text "committer_name"
    t.text "committer_email"
    t.text "message"
  end

  add_index "merge_request_diff_commits", ["merge_request_diff_id", "relative_order"], name: "index_merge_request_diff_commits_on_mr_diff_id_and_order", unique: true, using: :btree
1577
  add_index "merge_request_diff_commits", ["sha"], name: "index_merge_request_diff_commits_on_sha", using: :btree
1578

1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590
  create_table "merge_request_diff_files", id: false, force: :cascade do |t|
    t.integer "merge_request_diff_id", null: false
    t.integer "relative_order", null: false
    t.boolean "new_file", null: false
    t.boolean "renamed_file", null: false
    t.boolean "deleted_file", null: false
    t.boolean "too_large", null: false
    t.string "a_mode", null: false
    t.string "b_mode", null: false
    t.text "new_path", null: false
    t.text "old_path", null: false
    t.text "diff", null: false
1591
    t.boolean "binary"
1592 1593 1594 1595
  end

  add_index "merge_request_diff_files", ["merge_request_diff_id", "relative_order"], name: "index_merge_request_diff_files_on_mr_diff_id_and_order", unique: true, using: :btree

Valery Sizov's avatar
Valery Sizov committed
1596
  create_table "merge_request_diffs", force: :cascade do |t|
1597 1598
    t.string "state"
    t.integer "merge_request_id", null: false
1599 1600
    t.datetime "created_at"
    t.datetime "updated_at"
1601 1602 1603 1604
    t.string "base_commit_sha"
    t.string "real_size"
    t.string "head_commit_sha"
    t.string "start_commit_sha"
1605
    t.integer "commits_count"
1606 1607
  end

1608
  add_index "merge_request_diffs", ["merge_request_id", "id"], name: "index_merge_request_diffs_on_merge_request_id_and_id", using: :btree
1609

1610
  create_table "merge_request_metrics", force: :cascade do |t|
1611
    t.integer "merge_request_id", null: false
1612 1613 1614 1615
    t.datetime "latest_build_started_at"
    t.datetime "latest_build_finished_at"
    t.datetime "first_deployed_to_production_at"
    t.datetime "merged_at"
1616 1617
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
1618
    t.integer "pipeline_id"
1619 1620 1621
    t.integer "merged_by_id"
    t.integer "latest_closed_by_id"
    t.datetime_with_timezone "latest_closed_at"
1622 1623
  end

1624
  add_index "merge_request_metrics", ["first_deployed_to_production_at"], name: "index_merge_request_metrics_on_first_deployed_to_production_at", using: :btree
1625
  add_index "merge_request_metrics", ["merge_request_id"], name: "index_merge_request_metrics", using: :btree
1626
  add_index "merge_request_metrics", ["pipeline_id"], name: "index_merge_request_metrics_on_pipeline_id", using: :btree
1627

Valery Sizov's avatar
Valery Sizov committed
1628
  create_table "merge_requests", force: :cascade do |t|
1629 1630
    t.string "target_branch", null: false
    t.string "source_branch", null: false
1631
    t.integer "source_project_id"
1632 1633 1634
    t.integer "author_id"
    t.integer "assignee_id"
    t.string "title"
1635 1636
    t.datetime "created_at"
    t.datetime "updated_at"
1637
    t.integer "milestone_id"
1638 1639
    t.string "state", default: "opened", null: false
    t.string "merge_status", default: "unchecked", null: false
1640 1641 1642 1643 1644 1645
    t.integer "target_project_id", null: false
    t.integer "iid"
    t.text "description"
    t.integer "updated_by_id"
    t.text "merge_error"
    t.text "merge_params"
1646
    t.boolean "merge_when_pipeline_succeeds", default: false, null: false
1647 1648 1649 1650 1651 1652 1653 1654
    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"
1655
    t.integer "time_estimate"
1656
    t.integer "cached_markdown_version"
1657 1658
    t.datetime "last_edited_at"
    t.integer "last_edited_by_id"
1659
    t.integer "head_pipeline_id"
1660
    t.string "merge_jid"
1661
    t.boolean "discussion_locked"
1662
    t.integer "latest_merge_request_diff_id"
1663
    t.boolean "squash", default: false, null: false
1664
    t.boolean "allow_maintainer_to_push"
Andrew8xx8's avatar
Andrew8xx8 committed
1665 1666
  end

Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
1667 1668 1669
  add_index "merge_requests", ["assignee_id"], name: "index_merge_requests_on_assignee_id", using: :btree
  add_index "merge_requests", ["author_id"], name: "index_merge_requests_on_author_id", using: :btree
  add_index "merge_requests", ["created_at"], name: "index_merge_requests_on_created_at", using: :btree
1670
  add_index "merge_requests", ["description"], name: "index_merge_requests_on_description_trigram", using: :gin, opclasses: {"description"=>"gin_trgm_ops"}
1671
  add_index "merge_requests", ["head_pipeline_id"], name: "index_merge_requests_on_head_pipeline_id", using: :btree
1672
  add_index "merge_requests", ["latest_merge_request_diff_id"], name: "index_merge_requests_on_latest_merge_request_diff_id", using: :btree
1673
  add_index "merge_requests", ["merge_user_id"], name: "index_merge_requests_on_merge_user_id", where: "(merge_user_id IS NOT NULL)", using: :btree
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
1674 1675
  add_index "merge_requests", ["milestone_id"], name: "index_merge_requests_on_milestone_id", using: :btree
  add_index "merge_requests", ["source_branch"], name: "index_merge_requests_on_source_branch", using: :btree
1676
  add_index "merge_requests", ["source_project_id", "source_branch"], name: "index_merge_requests_on_source_project_and_branch_state_opened", where: "((state)::text = 'opened'::text)", using: :btree
1677
  add_index "merge_requests", ["source_project_id", "source_branch"], name: "index_merge_requests_on_source_project_id_and_source_branch", using: :btree
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
1678
  add_index "merge_requests", ["target_branch"], name: "index_merge_requests_on_target_branch", using: :btree
1679
  add_index "merge_requests", ["target_project_id", "iid"], name: "index_merge_requests_on_target_project_id_and_iid", unique: true, using: :btree
1680
  add_index "merge_requests", ["target_project_id", "iid"], name: "index_merge_requests_on_target_project_id_and_iid_opened", where: "((state)::text = 'opened'::text)", using: :btree
1681
  add_index "merge_requests", ["target_project_id", "merge_commit_sha", "id"], name: "index_merge_requests_on_tp_id_and_merge_commit_sha_and_id", using: :btree
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
1682
  add_index "merge_requests", ["title"], name: "index_merge_requests_on_title", using: :btree
1683
  add_index "merge_requests", ["title"], name: "index_merge_requests_on_title_trigram", using: :gin, opclasses: {"title"=>"gin_trgm_ops"}
1684
  add_index "merge_requests", ["updated_by_id"], name: "index_merge_requests_on_updated_by_id", where: "(updated_by_id IS NOT NULL)", using: :btree
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
1685

1686
  create_table "merge_requests_closing_issues", force: :cascade do |t|
1687 1688 1689 1690
    t.integer "merge_request_id", null: false
    t.integer "issue_id", null: false
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
1691 1692 1693 1694 1695
  end

  add_index "merge_requests_closing_issues", ["issue_id"], name: "index_merge_requests_closing_issues_on_issue_id", using: :btree
  add_index "merge_requests_closing_issues", ["merge_request_id"], name: "index_merge_requests_closing_issues_on_merge_request_id", using: :btree

Valery Sizov's avatar
Valery Sizov committed
1696
  create_table "milestones", force: :cascade do |t|
1697
    t.string "title", null: false
Felipe Artur's avatar
Felipe Artur committed
1698
    t.integer "project_id"
1699 1700
    t.text "description"
    t.date "due_date"
Kamil Trzcinski's avatar
Kamil Trzcinski committed
1701 1702
    t.datetime "created_at"
    t.datetime "updated_at"
1703 1704 1705 1706
    t.string "state"
    t.integer "iid"
    t.text "title_html"
    t.text "description_html"
1707
    t.date "start_date"
1708
    t.integer "cached_markdown_version"
Felipe Artur's avatar
Felipe Artur committed
1709
    t.integer "group_id"
Andrew8xx8's avatar
Andrew8xx8 committed
1710 1711
  end

1712
  add_index "milestones", ["description"], name: "index_milestones_on_description_trigram", using: :gin, opclasses: {"description"=>"gin_trgm_ops"}
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
1713
  add_index "milestones", ["due_date"], name: "index_milestones_on_due_date", using: :btree
Felipe Artur's avatar
Felipe Artur committed
1714
  add_index "milestones", ["group_id"], name: "index_milestones_on_group_id", using: :btree
1715
  add_index "milestones", ["project_id", "iid"], name: "index_milestones_on_project_id_and_iid", unique: true, using: :btree
1716
  add_index "milestones", ["title"], name: "index_milestones_on_title", using: :btree
1717
  add_index "milestones", ["title"], name: "index_milestones_on_title_trigram", using: :gin, opclasses: {"title"=>"gin_trgm_ops"}
Andrew8xx8's avatar
Andrew8xx8 committed
1718

1719 1720
  create_table "namespace_statistics", force: :cascade do |t|
    t.integer "namespace_id", null: false
1721 1722
    t.integer "shared_runners_seconds", default: 0, null: false
    t.datetime "shared_runners_seconds_last_reset"
1723 1724 1725 1726
  end

  add_index "namespace_statistics", ["namespace_id"], name: "index_namespace_statistics_on_namespace_id", unique: true, using: :btree

Valery Sizov's avatar
Valery Sizov committed
1727
  create_table "namespaces", force: :cascade do |t|
1728 1729 1730
    t.string "name", null: false
    t.string "path", null: false
    t.integer "owner_id"
Kamil Trzcinski's avatar
Kamil Trzcinski committed
1731 1732
    t.datetime "created_at"
    t.datetime "updated_at"
1733 1734 1735 1736 1737 1738
    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
1739
    t.boolean "request_access_enabled", default: false, null: false
1740 1741
    t.string "ldap_sync_status", default: "ready", null: false
    t.string "ldap_sync_error"
1742 1743 1744
    t.datetime "ldap_sync_last_update_at"
    t.datetime "ldap_sync_last_successful_update_at"
    t.datetime "ldap_sync_last_sync_at"
Nick Thomas's avatar
Nick Thomas committed
1745
    t.text "description_html"
1746
    t.boolean "lfs_enabled"
1747
    t.integer "parent_id"
1748 1749
    t.integer "shared_runners_minutes_limit"
    t.integer "repository_size_limit", limit: 8
1750 1751
    t.boolean "require_two_factor_authentication", default: false, null: false
    t.integer "two_factor_grace_period", default: 48, null: false
1752
    t.integer "cached_markdown_version"
1753
    t.integer "plan_id"
1754
    t.integer "project_creation_level"
1755
    t.string "runners_token"
1756
    t.datetime_with_timezone "trial_ends_on"
Andrew8xx8's avatar
Andrew8xx8 committed
1757 1758
  end

1759
  add_index "namespaces", ["created_at"], name: "index_namespaces_on_created_at", using: :btree
1760 1761
  add_index "namespaces", ["ldap_sync_last_successful_update_at"], name: "index_namespaces_on_ldap_sync_last_successful_update_at", using: :btree
  add_index "namespaces", ["ldap_sync_last_update_at"], name: "index_namespaces_on_ldap_sync_last_update_at", using: :btree
1762
  add_index "namespaces", ["name", "parent_id"], name: "index_namespaces_on_name_and_parent_id", unique: true, using: :btree
1763
  add_index "namespaces", ["name"], name: "index_namespaces_on_name_trigram", using: :gin, opclasses: {"name"=>"gin_trgm_ops"}
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
1764
  add_index "namespaces", ["owner_id"], name: "index_namespaces_on_owner_id", using: :btree
1765
  add_index "namespaces", ["parent_id", "id"], name: "index_namespaces_on_parent_id_and_id", unique: true, using: :btree
1766
  add_index "namespaces", ["path"], name: "index_namespaces_on_path", using: :btree
1767
  add_index "namespaces", ["path"], name: "index_namespaces_on_path_trigram", using: :gin, opclasses: {"path"=>"gin_trgm_ops"}
1768
  add_index "namespaces", ["plan_id"], name: "index_namespaces_on_plan_id", using: :btree
1769
  add_index "namespaces", ["require_two_factor_authentication"], name: "index_namespaces_on_require_two_factor_authentication", using: :btree
1770
  add_index "namespaces", ["runners_token"], name: "index_namespaces_on_runners_token", unique: true, using: :btree
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
1771
  add_index "namespaces", ["type"], name: "index_namespaces_on_type", using: :btree
Andrew8xx8's avatar
Andrew8xx8 committed
1772

1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786
  create_table "note_diff_files", force: :cascade do |t|
    t.integer "diff_note_id", null: false
    t.text "diff", null: false
    t.boolean "new_file", null: false
    t.boolean "renamed_file", null: false
    t.boolean "deleted_file", null: false
    t.string "a_mode", null: false
    t.string "b_mode", null: false
    t.text "new_path", null: false
    t.text "old_path", null: false
  end

  add_index "note_diff_files", ["diff_note_id"], name: "index_note_diff_files_on_diff_note_id", unique: true, using: :btree

Valery Sizov's avatar
Valery Sizov committed
1787
  create_table "notes", force: :cascade do |t|
1788 1789 1790
    t.text "note"
    t.string "noteable_type"
    t.integer "author_id"
1791 1792
    t.datetime "created_at"
    t.datetime "updated_at"
1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803
    t.integer "project_id"
    t.string "attachment"
    t.string "line_code"
    t.string "commit_id"
    t.integer "noteable_id"
    t.boolean "system", default: false, null: false
    t.text "st_diff"
    t.integer "updated_by_id"
    t.string "type"
    t.text "position"
    t.text "original_position"
1804
    t.datetime "resolved_at"
1805 1806 1807
    t.integer "resolved_by_id"
    t.string "discussion_id"
    t.text "note_html"
1808
    t.integer "cached_markdown_version"
1809
    t.text "change_position"
1810
    t.boolean "resolved_by_push"
Andrew8xx8's avatar
Andrew8xx8 committed
1811 1812
  end

Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
1813 1814 1815
  add_index "notes", ["author_id"], name: "index_notes_on_author_id", using: :btree
  add_index "notes", ["commit_id"], name: "index_notes_on_commit_id", using: :btree
  add_index "notes", ["created_at"], name: "index_notes_on_created_at", using: :btree
1816
  add_index "notes", ["discussion_id"], name: "index_notes_on_discussion_id", using: :btree
1817
  add_index "notes", ["line_code"], name: "index_notes_on_line_code", using: :btree
1818
  add_index "notes", ["note"], name: "index_notes_on_note_trigram", using: :gin, opclasses: {"note"=>"gin_trgm_ops"}
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
1819 1820 1821
  add_index "notes", ["noteable_id", "noteable_type"], name: "index_notes_on_noteable_id_and_noteable_type", using: :btree
  add_index "notes", ["noteable_type"], name: "index_notes_on_noteable_type", using: :btree
  add_index "notes", ["project_id", "noteable_type"], name: "index_notes_on_project_id_and_noteable_type", using: :btree
1822
  add_index "notes", ["updated_at"], name: "index_notes_on_updated_at", using: :btree
Andrew8xx8's avatar
Andrew8xx8 committed
1823

1824
  create_table "notification_settings", force: :cascade do |t|
1825 1826 1827 1828 1829 1830
    t.integer "user_id", null: false
    t.integer "source_id"
    t.string "source_type"
    t.integer "level", default: 0, null: false
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842
    t.boolean "new_note"
    t.boolean "new_issue"
    t.boolean "reopen_issue"
    t.boolean "close_issue"
    t.boolean "reassign_issue"
    t.boolean "new_merge_request"
    t.boolean "reopen_merge_request"
    t.boolean "close_merge_request"
    t.boolean "reassign_merge_request"
    t.boolean "merge_merge_request"
    t.boolean "failed_pipeline"
    t.boolean "success_pipeline"
1843
    t.boolean "push_to_merge_request"
1844
    t.boolean "issue_due"
1845 1846
  end

1847
  add_index "notification_settings", ["source_id", "source_type"], name: "index_notification_settings_on_source_id_and_source_type", using: :btree
Valery Sizov's avatar
Valery Sizov committed
1848
  add_index "notification_settings", ["user_id", "source_id", "source_type"], name: "index_notifications_on_user_id_and_source_id_and_source_type", unique: true, using: :btree
1849 1850
  add_index "notification_settings", ["user_id"], name: "index_notification_settings_on_user_id", using: :btree

Valery Sizov's avatar
Valery Sizov committed
1851
  create_table "oauth_access_grants", force: :cascade do |t|
1852 1853 1854 1855 1856 1857
    t.integer "resource_owner_id", null: false
    t.integer "application_id", null: false
    t.string "token", null: false
    t.integer "expires_in", null: false
    t.text "redirect_uri", null: false
    t.datetime "created_at", null: false
Valery Sizov's avatar
Valery Sizov committed
1858
    t.datetime "revoked_at"
1859
    t.string "scopes"
Valery Sizov's avatar
Valery Sizov committed
1860 1861 1862 1863
  end

  add_index "oauth_access_grants", ["token"], name: "index_oauth_access_grants_on_token", unique: true, using: :btree

Valery Sizov's avatar
Valery Sizov committed
1864
  create_table "oauth_access_tokens", force: :cascade do |t|
1865 1866 1867 1868 1869
    t.integer "resource_owner_id"
    t.integer "application_id"
    t.string "token", null: false
    t.string "refresh_token"
    t.integer "expires_in"
Valery Sizov's avatar
Valery Sizov committed
1870
    t.datetime "revoked_at"
1871 1872
    t.datetime "created_at", null: false
    t.string "scopes"
Valery Sizov's avatar
Valery Sizov committed
1873 1874 1875 1876 1877 1878
  end

  add_index "oauth_access_tokens", ["refresh_token"], name: "index_oauth_access_tokens_on_refresh_token", unique: true, using: :btree
  add_index "oauth_access_tokens", ["resource_owner_id"], name: "index_oauth_access_tokens_on_resource_owner_id", using: :btree
  add_index "oauth_access_tokens", ["token"], name: "index_oauth_access_tokens_on_token", unique: true, using: :btree

Valery Sizov's avatar
Valery Sizov committed
1879
  create_table "oauth_applications", force: :cascade do |t|
1880 1881 1882 1883 1884
    t.string "name", null: false
    t.string "uid", null: false
    t.string "secret", null: false
    t.text "redirect_uri", null: false
    t.string "scopes", default: "", null: false
Valery Sizov's avatar
Valery Sizov committed
1885 1886
    t.datetime "created_at"
    t.datetime "updated_at"
1887 1888
    t.integer "owner_id"
    t.string "owner_type"
1889
    t.boolean "trusted", default: false, null: false
Valery Sizov's avatar
Valery Sizov committed
1890 1891 1892 1893 1894
  end

  add_index "oauth_applications", ["owner_id", "owner_type"], name: "index_oauth_applications_on_owner_id_and_owner_type", using: :btree
  add_index "oauth_applications", ["uid"], name: "index_oauth_applications_on_uid", unique: true, using: :btree

1895 1896 1897 1898 1899
  create_table "oauth_openid_requests", force: :cascade do |t|
    t.integer "access_grant_id", null: false
    t.string "nonce", null: false
  end

Kamil Trzcinski's avatar
Kamil Trzcinski committed
1900 1901
  create_table "pages_domains", force: :cascade do |t|
    t.integer "project_id"
1902 1903 1904 1905 1906
    t.text "certificate"
    t.text "encrypted_key"
    t.string "encrypted_key_iv"
    t.string "encrypted_key_salt"
    t.string "domain"
1907 1908 1909
    t.datetime_with_timezone "verified_at"
    t.string "verification_code", null: false
    t.datetime_with_timezone "enabled_until"
Kamil Trzcinski's avatar
Kamil Trzcinski committed
1910 1911 1912
  end

  add_index "pages_domains", ["domain"], name: "index_pages_domains_on_domain", unique: true, using: :btree
1913
  add_index "pages_domains", ["project_id", "enabled_until"], name: "index_pages_domains_on_project_id_and_enabled_until", using: :btree
1914
  add_index "pages_domains", ["project_id"], name: "index_pages_domains_on_project_id", using: :btree
1915 1916
  add_index "pages_domains", ["verified_at", "enabled_until"], name: "index_pages_domains_on_verified_at_and_enabled_until", using: :btree
  add_index "pages_domains", ["verified_at"], name: "index_pages_domains_on_verified_at", using: :btree
Kamil Trzcinski's avatar
Kamil Trzcinski committed
1917

Valery Sizov's avatar
Valery Sizov committed
1918
  create_table "path_locks", force: :cascade do |t|
1919 1920 1921
    t.string "path", null: false
    t.integer "project_id"
    t.integer "user_id"
Valery Sizov's avatar
Valery Sizov committed
1922 1923 1924 1925 1926 1927 1928
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
  end

  add_index "path_locks", ["path"], name: "index_path_locks_on_path", using: :btree
  add_index "path_locks", ["project_id"], name: "index_path_locks_on_project_id", using: :btree
  add_index "path_locks", ["user_id"], name: "index_path_locks_on_user_id", using: :btree
Valery Sizov's avatar
Valery Sizov committed
1929

1930
  create_table "personal_access_tokens", force: :cascade do |t|
1931 1932 1933 1934
    t.integer "user_id", null: false
    t.string "token", null: false
    t.string "name", null: false
    t.boolean "revoked", default: false
1935
    t.date "expires_at"
1936 1937
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
1938
    t.string "scopes", default: "--- []\n", null: false
Simon Vocella's avatar
Simon Vocella committed
1939
    t.boolean "impersonation", default: false, null: false
1940 1941 1942 1943
  end

  add_index "personal_access_tokens", ["token"], name: "index_personal_access_tokens_on_token", unique: true, using: :btree
  add_index "personal_access_tokens", ["user_id"], name: "index_personal_access_tokens_on_user_id", using: :btree
Valery Sizov's avatar
Valery Sizov committed
1944

1945
  create_table "plans", force: :cascade do |t|
1946 1947
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
1948 1949
    t.string "name"
    t.string "title"
1950 1951
    t.integer "active_pipelines_limit"
    t.integer "pipeline_size_limit"
1952 1953 1954 1955
  end

  add_index "plans", ["name"], name: "index_plans_on_name", using: :btree

1956
  create_table "project_authorizations", id: false, force: :cascade do |t|
1957 1958 1959
    t.integer "user_id", null: false
    t.integer "project_id", null: false
    t.integer "access_level", null: false
1960 1961
  end

1962
  add_index "project_authorizations", ["project_id"], name: "index_project_authorizations_on_project_id", using: :btree
1963 1964
  add_index "project_authorizations", ["user_id", "project_id", "access_level"], name: "index_project_authorizations_on_user_id_project_id_access_level", unique: true, using: :btree

1965
  create_table "project_auto_devops", force: :cascade do |t|
Zeger-Jan van de Weg's avatar
Zeger-Jan van de Weg committed
1966
    t.integer "project_id", null: false
1967 1968
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
1969 1970
    t.boolean "enabled"
    t.string "domain"
1971
    t.integer "deploy_strategy", default: 0, null: false
1972 1973
  end

Zeger-Jan van de Weg's avatar
Zeger-Jan van de Weg committed
1974
  add_index "project_auto_devops", ["project_id"], name: "index_project_auto_devops_on_project_id", unique: true, using: :btree
1975

1976 1977 1978 1979 1980 1981 1982
  create_table "project_ci_cd_settings", force: :cascade do |t|
    t.integer "project_id", null: false
    t.boolean "group_runners_enabled", default: true, null: false
  end

  add_index "project_ci_cd_settings", ["project_id"], name: "index_project_ci_cd_settings_on_project_id", unique: true, using: :btree

1983
  create_table "project_custom_attributes", force: :cascade do |t|
1984 1985
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
1986 1987 1988 1989 1990 1991 1992 1993
    t.integer "project_id", null: false
    t.string "key", null: false
    t.string "value", null: false
  end

  add_index "project_custom_attributes", ["key", "value"], name: "index_project_custom_attributes_on_key_and_value", using: :btree
  add_index "project_custom_attributes", ["project_id", "key"], name: "index_project_custom_attributes_on_project_id_and_key", unique: true, using: :btree

1994 1995 1996
  create_table "project_deploy_tokens", force: :cascade do |t|
    t.integer "project_id", null: false
    t.integer "deploy_token_id", null: false
1997
    t.datetime_with_timezone "created_at", null: false
1998 1999
  end

2000
  add_index "project_deploy_tokens", ["project_id", "deploy_token_id"], name: "index_project_deploy_tokens_on_project_id_and_deploy_token_id", unique: true, using: :btree
2001

2002
  create_table "project_features", force: :cascade do |t|
2003
    t.integer "project_id", null: false
2004 2005 2006 2007 2008
    t.integer "merge_requests_access_level"
    t.integer "issues_access_level"
    t.integer "wiki_access_level"
    t.integer "snippets_access_level"
    t.integer "builds_access_level"
2009 2010
    t.datetime "created_at"
    t.datetime "updated_at"
2011
    t.integer "repository_access_level", default: 20, null: false
2012 2013
  end

2014
  add_index "project_features", ["project_id"], name: "index_project_features_on_project_id", unique: true, using: :btree
2015

Valery Sizov's avatar
Valery Sizov committed
2016
  create_table "project_group_links", force: :cascade do |t|
2017 2018
    t.integer "project_id", null: false
    t.integer "group_id", null: false
Valery Sizov's avatar
Valery Sizov committed
2019 2020
    t.datetime "created_at"
    t.datetime "updated_at"
2021 2022
    t.integer "group_access", default: 30, null: false
    t.date "expires_at"
Valery Sizov's avatar
Valery Sizov committed
2023 2024
  end

2025
  add_index "project_group_links", ["group_id"], name: "index_project_group_links_on_group_id", using: :btree
2026
  add_index "project_group_links", ["project_id"], name: "index_project_group_links_on_project_id", using: :btree
2027

Valery Sizov's avatar
Valery Sizov committed
2028
  create_table "project_import_data", force: :cascade do |t|
2029
    t.integer "project_id"
2030 2031 2032 2033
    t.text "data"
    t.text "encrypted_credentials"
    t.string "encrypted_credentials_iv"
    t.string "encrypted_credentials_salt"
2034 2035
  end

2036 2037
  add_index "project_import_data", ["project_id"], name: "index_project_import_data_on_project_id", using: :btree

2038
  create_table "project_mirror_data", force: :cascade do |t|
2039
    t.integer "project_id", null: false
2040 2041 2042
    t.integer "retry_count", default: 0, null: false
    t.datetime "last_update_started_at"
    t.datetime "last_update_scheduled_at"
2043
    t.datetime "next_execution_timestamp"
2044 2045 2046 2047
    t.string "status"
    t.string "jid"
    t.datetime_with_timezone "last_update_at"
    t.datetime_with_timezone "last_successful_update_at"
Micaël Bergeron's avatar
Micaël Bergeron committed
2048
    t.text "last_error"
2049 2050
  end

Tiago Botelho's avatar
Tiago Botelho committed
2051 2052
  add_index "project_mirror_data", ["jid"], name: "index_project_mirror_data_on_jid", using: :btree
  add_index "project_mirror_data", ["last_successful_update_at"], name: "index_project_mirror_data_on_last_successful_update_at", using: :btree
2053
  add_index "project_mirror_data", ["next_execution_timestamp", "retry_count"], name: "index_mirror_data_on_next_execution_and_retry_count", using: :btree
2054
  add_index "project_mirror_data", ["project_id"], name: "index_project_mirror_data_on_project_id", unique: true, using: :btree
Tiago Botelho's avatar
Tiago Botelho committed
2055
  add_index "project_mirror_data", ["status"], name: "index_project_mirror_data_on_status", using: :btree
2056

2057 2058 2059 2060 2061 2062
  create_table "project_repository_states", force: :cascade do |t|
    t.integer "project_id", null: false
    t.binary "repository_verification_checksum"
    t.binary "wiki_verification_checksum"
    t.string "last_repository_verification_failure"
    t.string "last_wiki_verification_failure"
2063 2064 2065 2066
    t.datetime_with_timezone "repository_retry_at"
    t.datetime_with_timezone "wiki_retry_at"
    t.integer "repository_retry_count"
    t.integer "wiki_retry_count"
2067 2068
  end

2069 2070
  add_index "project_repository_states", ["last_repository_verification_failure"], name: "idx_repository_states_on_repository_failure_partial", where: "(last_repository_verification_failure IS NOT NULL)", using: :btree
  add_index "project_repository_states", ["last_wiki_verification_failure"], name: "idx_repository_states_on_wiki_failure_partial", where: "(last_wiki_verification_failure IS NOT NULL)", using: :btree
2071
  add_index "project_repository_states", ["project_id"], name: "idx_repository_states_outdated_checksums", where: "(((repository_verification_checksum IS NULL) AND (last_repository_verification_failure IS NULL)) OR ((wiki_verification_checksum IS NULL) AND (last_wiki_verification_failure IS NULL)))", using: :btree
2072 2073
  add_index "project_repository_states", ["project_id"], name: "index_project_repository_states_on_project_id", unique: true, using: :btree

2074 2075 2076 2077 2078 2079 2080 2081
  create_table "project_statistics", force: :cascade do |t|
    t.integer "project_id", null: false
    t.integer "namespace_id", null: false
    t.integer "commit_count", limit: 8, default: 0, null: false
    t.integer "storage_size", limit: 8, default: 0, null: false
    t.integer "repository_size", limit: 8, default: 0, null: false
    t.integer "lfs_objects_size", limit: 8, default: 0, null: false
    t.integer "build_artifacts_size", limit: 8, default: 0, null: false
2082 2083
    t.integer "shared_runners_seconds", limit: 8, default: 0, null: false
    t.datetime "shared_runners_seconds_last_reset"
2084 2085 2086 2087 2088
  end

  add_index "project_statistics", ["namespace_id"], name: "index_project_statistics_on_namespace_id", using: :btree
  add_index "project_statistics", ["project_id"], name: "index_project_statistics_on_project_id", unique: true, using: :btree

Valery Sizov's avatar
Valery Sizov committed
2089
  create_table "projects", force: :cascade do |t|
2090 2091 2092
    t.string "name"
    t.string "path"
    t.text "description"
2093 2094
    t.datetime "created_at"
    t.datetime "updated_at"
2095
    t.integer "creator_id"
2096
    t.integer "namespace_id", null: false
2097
    t.datetime "last_activity_at"
2098 2099 2100 2101
    t.string "import_url"
    t.integer "visibility_level", default: 0, null: false
    t.boolean "archived", default: false, null: false
    t.string "avatar"
Tiago Botelho's avatar
Tiago Botelho committed
2102
    t.string "import_status"
2103 2104
    t.text "merge_requests_template"
    t.integer "star_count", default: 0, null: false
2105
    t.boolean "merge_requests_rebase_enabled", default: false
2106 2107 2108 2109
    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
2110
    t.boolean "merge_requests_ff_only_enabled", default: false
2111 2112
    t.text "issues_template"
    t.boolean "mirror", default: false, null: false
Tiago Botelho's avatar
Tiago Botelho committed
2113 2114
    t.datetime "mirror_last_update_at"
    t.datetime "mirror_last_successful_update_at"
2115
    t.integer "mirror_user_id"
Tiago Botelho's avatar
Tiago Botelho committed
2116
    t.text "import_error"
2117 2118 2119 2120 2121 2122 2123 2124 2125 2126
    t.integer "ci_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"
2127
    t.datetime "last_repository_check_at"
2128
    t.boolean "container_registry_enabled"
2129
    t.boolean "only_allow_merge_if_pipeline_succeeds", default: false, null: false
2130 2131
    t.boolean "has_external_issue_tracker"
    t.string "repository_storage", default: "default", null: false
2132
    t.boolean "repository_read_only"
2133
    t.boolean "request_access_enabled", default: false, null: false
2134
    t.boolean "has_external_wiki"
2135
    t.string "ci_config_path"
2136 2137
    t.boolean "lfs_enabled"
    t.text "description_html"
2138
    t.boolean "only_allow_merge_if_all_discussions_are_resolved"
2139
    t.integer "repository_size_limit", limit: 8
2140
    t.boolean "printing_merge_request_link_enabled", default: true, null: false
2141
    t.integer "auto_cancel_pending_pipelines", default: 1, null: false
2142
    t.boolean "service_desk_enabled", default: true
Tiago Botelho's avatar
Tiago Botelho committed
2143
    t.string "import_jid"
2144
    t.integer "cached_markdown_version"
2145
    t.text "delete_error"
2146
    t.datetime "last_repository_updated_at"
Simon Knox's avatar
Simon Knox committed
2147
    t.boolean "disable_overriding_approvers_per_merge_request"
2148
    t.integer "storage_version", limit: 2
Sean McGivern's avatar
Sean McGivern committed
2149
    t.boolean "resolve_outdated_diff_discussions"
2150
    t.boolean "remote_mirror_available_overridden"
2151
    t.boolean "only_mirror_protected_branches"
2152
    t.boolean "pull_mirror_available_overridden"
2153
    t.integer "jobs_cache_index"
2154
    t.boolean "mirror_overwrites_diverged_branches"
2155
    t.string "external_authorization_classification_label"
2156
    t.string "external_webhook_token"
Rob Watson's avatar
Rob Watson committed
2157
    t.boolean "pages_https_only", default: true
Andrew8xx8's avatar
Andrew8xx8 committed
2158 2159
  end

2160
  add_index "projects", ["ci_id"], name: "index_projects_on_ci_id", using: :btree
2161
  add_index "projects", ["created_at"], name: "index_projects_on_created_at", using: :btree
2162
  add_index "projects", ["creator_id"], name: "index_projects_on_creator_id", using: :btree
2163
  add_index "projects", ["description"], name: "index_projects_on_description_trigram", using: :gin, opclasses: {"description"=>"gin_trgm_ops"}
2164
  add_index "projects", ["id", "repository_storage", "last_repository_updated_at"], name: "idx_projects_on_repository_storage_last_repository_updated_at", using: :btree
2165
  add_index "projects", ["id"], name: "index_projects_on_id_partial_for_visibility", unique: true, where: "(visibility_level = ANY (ARRAY[10, 20]))", using: :btree
2166
  add_index "projects", ["id"], name: "index_projects_on_mirror_and_mirror_trigger_builds_both_true", where: "((mirror IS TRUE) AND (mirror_trigger_builds IS TRUE))", using: :btree
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
2167
  add_index "projects", ["last_activity_at"], name: "index_projects_on_last_activity_at", using: :btree
2168
  add_index "projects", ["last_repository_check_at"], name: "index_projects_on_last_repository_check_at", where: "(last_repository_check_at IS NOT NULL)", using: :btree
2169
  add_index "projects", ["last_repository_check_failed"], name: "index_projects_on_last_repository_check_failed", using: :btree
2170
  add_index "projects", ["last_repository_updated_at"], name: "index_projects_on_last_repository_updated_at", using: :btree
Tiago Botelho's avatar
Tiago Botelho committed
2171
  add_index "projects", ["mirror_last_successful_update_at"], name: "index_projects_on_mirror_last_successful_update_at", using: :btree
2172
  add_index "projects", ["name"], name: "index_projects_on_name_trigram", using: :gin, opclasses: {"name"=>"gin_trgm_ops"}
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
2173
  add_index "projects", ["namespace_id"], name: "index_projects_on_namespace_id", using: :btree
Kamil Trzcinski's avatar
Kamil Trzcinski committed
2174
  add_index "projects", ["path"], name: "index_projects_on_path", using: :btree
2175
  add_index "projects", ["path"], name: "index_projects_on_path_trigram", using: :gin, opclasses: {"path"=>"gin_trgm_ops"}
2176
  add_index "projects", ["pending_delete"], name: "index_projects_on_pending_delete", using: :btree
Valery Sizov's avatar
Valery Sizov committed
2177
  add_index "projects", ["repository_storage", "created_at"], name: "idx_project_repository_check_partial", where: "(last_repository_check_at IS NULL)", using: :btree
2178
  add_index "projects", ["repository_storage"], name: "index_projects_on_repository_storage", using: :btree
2179
  add_index "projects", ["runners_token"], name: "index_projects_on_runners_token", using: :btree
2180
  add_index "projects", ["star_count"], name: "index_projects_on_star_count", using: :btree
2181
  add_index "projects", ["visibility_level"], name: "index_projects_on_visibility_level", using: :btree
Andrew8xx8's avatar
Andrew8xx8 committed
2182

2183 2184
  create_table "prometheus_metrics", force: :cascade do |t|
    t.integer "project_id"
2185 2186
    t.string "title", null: false
    t.string "query", null: false
2187 2188 2189
    t.string "y_label"
    t.string "unit"
    t.string "legend"
2190
    t.integer "group", null: false
2191 2192 2193 2194
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
  end

Pawel Chojnacki's avatar
Pawel Chojnacki committed
2195
  add_index "prometheus_metrics", ["group"], name: "index_prometheus_metrics_on_group", using: :btree
2196 2197
  add_index "prometheus_metrics", ["project_id"], name: "index_prometheus_metrics_on_project_id", using: :btree

2198
  create_table "protected_branch_merge_access_levels", force: :cascade do |t|
2199
    t.integer "protected_branch_id", null: false
2200
    t.integer "access_level", default: 40
2201 2202 2203
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
    t.integer "user_id"
2204
    t.integer "group_id"
2205 2206 2207
  end

  add_index "protected_branch_merge_access_levels", ["protected_branch_id"], name: "index_protected_branch_merge_access", using: :btree
2208
  add_index "protected_branch_merge_access_levels", ["user_id"], name: "index_protected_branch_merge_access_levels_on_user_id", using: :btree
2209 2210

  create_table "protected_branch_push_access_levels", force: :cascade do |t|
2211
    t.integer "protected_branch_id", null: false
2212
    t.integer "access_level", default: 40
2213 2214 2215
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
    t.integer "user_id"
2216
    t.integer "group_id"
2217 2218 2219
  end

  add_index "protected_branch_push_access_levels", ["protected_branch_id"], name: "index_protected_branch_push_access", using: :btree
2220
  add_index "protected_branch_push_access_levels", ["user_id"], name: "index_protected_branch_push_access_levels_on_user_id", using: :btree
2221

2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232
  create_table "protected_branch_unprotect_access_levels", force: :cascade do |t|
    t.integer "protected_branch_id", null: false
    t.integer "access_level", default: 40
    t.integer "user_id"
    t.integer "group_id"
  end

  add_index "protected_branch_unprotect_access_levels", ["group_id"], name: "index_protected_branch_unprotect_access_levels_on_group_id", using: :btree
  add_index "protected_branch_unprotect_access_levels", ["protected_branch_id"], name: "index_protected_branch_unprotect_access", using: :btree
  add_index "protected_branch_unprotect_access_levels", ["user_id"], name: "index_protected_branch_unprotect_access_levels_on_user_id", using: :btree

Valery Sizov's avatar
Valery Sizov committed
2233
  create_table "protected_branches", force: :cascade do |t|
2234 2235
    t.integer "project_id", null: false
    t.string "name", null: false
Kamil Trzcinski's avatar
Kamil Trzcinski committed
2236 2237
    t.datetime "created_at"
    t.datetime "updated_at"
Andrew8xx8's avatar
Andrew8xx8 committed
2238 2239
  end

Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
2240
  add_index "protected_branches", ["project_id"], name: "index_protected_branches_on_project_id", using: :btree
2241

2242
  create_table "protected_tag_create_access_levels", force: :cascade do |t|
2243 2244 2245 2246 2247 2248 2249 2250
    t.integer "protected_tag_id", null: false
    t.integer "access_level", default: 40
    t.integer "user_id"
    t.integer "group_id"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
  end

2251 2252
  add_index "protected_tag_create_access_levels", ["protected_tag_id"], name: "index_protected_tag_create_access", using: :btree
  add_index "protected_tag_create_access_levels", ["user_id"], name: "index_protected_tag_create_access_levels_on_user_id", using: :btree
2253 2254 2255 2256 2257 2258 2259 2260 2261 2262

  create_table "protected_tags", force: :cascade do |t|
    t.integer "project_id", null: false
    t.string "name", null: false
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
  end

  add_index "protected_tags", ["project_id"], name: "index_protected_tags_on_project_id", using: :btree

2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275
  create_table "push_event_payloads", id: false, force: :cascade do |t|
    t.integer "commit_count", limit: 8, null: false
    t.integer "event_id", null: false
    t.integer "action", limit: 2, null: false
    t.integer "ref_type", limit: 2, null: false
    t.binary "commit_from"
    t.binary "commit_to"
    t.text "ref"
    t.string "commit_title", limit: 70
  end

  add_index "push_event_payloads", ["event_id"], name: "index_push_event_payloads_on_event_id", unique: true, using: :btree

2276
  create_table "push_rules", force: :cascade do |t|
2277 2278 2279 2280 2281
    t.string "force_push_regex"
    t.string "delete_branch_regex"
    t.string "commit_message_regex"
    t.boolean "deny_delete_tag"
    t.integer "project_id"
2282 2283
    t.datetime "created_at"
    t.datetime "updated_at"
2284 2285 2286 2287 2288 2289
    t.string "author_email_regex"
    t.boolean "member_check", default: false, null: false
    t.string "file_name_regex"
    t.boolean "is_sample", default: false
    t.integer "max_file_size", default: 0, null: false
    t.boolean "prevent_secrets", default: false, null: false
2290
    t.string "branch_name_regex"
2291
    t.boolean "reject_unsigned_commits"
2292
    t.boolean "commit_committer_check"
2293
    t.boolean "regexp_uses_re2", default: true
2294
    t.string "commit_message_negative_regex"
2295 2296
  end

2297
  add_index "push_rules", ["is_sample"], name: "index_push_rules_on_is_sample", where: "is_sample", using: :btree
2298
  add_index "push_rules", ["project_id"], name: "index_push_rules_on_project_id", using: :btree
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
2299

2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310
  create_table "redirect_routes", force: :cascade do |t|
    t.integer "source_id", null: false
    t.string "source_type", null: false
    t.string "path", null: false
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
  end

  add_index "redirect_routes", ["path"], name: "index_redirect_routes_on_path", unique: true, using: :btree
  add_index "redirect_routes", ["source_type", "source_id"], name: "index_redirect_routes_on_source_type_and_source_id", using: :btree

Valery Sizov's avatar
Valery Sizov committed
2311
  create_table "releases", force: :cascade do |t|
2312 2313 2314
    t.string "tag"
    t.text "description"
    t.integer "project_id"
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
2315 2316
    t.datetime "created_at"
    t.datetime "updated_at"
2317
    t.text "description_html"
2318
    t.integer "cached_markdown_version"
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
2319 2320 2321 2322 2323
  end

  add_index "releases", ["project_id", "tag"], name: "index_releases_on_project_id_and_tag", using: :btree
  add_index "releases", ["project_id"], name: "index_releases_on_project_id", using: :btree

2324
  create_table "remote_mirrors", force: :cascade do |t|
2325 2326 2327 2328
    t.integer "project_id"
    t.string "url"
    t.boolean "enabled", default: false
    t.string "update_status"
2329 2330
    t.datetime "last_update_at"
    t.datetime "last_successful_update_at"
2331 2332 2333 2334 2335 2336
    t.string "last_error"
    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
2337
    t.datetime "last_update_started_at"
2338
    t.boolean "only_protected_branches", default: false, null: false
2339
    t.string "remote_name"
2340 2341
  end

2342
  add_index "remote_mirrors", ["last_successful_update_at"], name: "index_remote_mirrors_on_last_successful_update_at", using: :btree
2343
  add_index "remote_mirrors", ["project_id"], name: "index_remote_mirrors_on_project_id", using: :btree
2344

2345 2346 2347 2348 2349 2350
  create_table "routes", force: :cascade do |t|
    t.integer "source_id", null: false
    t.string "source_type", null: false
    t.string "path", null: false
    t.datetime "created_at"
    t.datetime "updated_at"
2351
    t.string "name"
2352 2353 2354
  end

  add_index "routes", ["path"], name: "index_routes_on_path", unique: true, using: :btree
2355
  add_index "routes", ["path"], name: "index_routes_on_path_text_pattern_ops", using: :btree, opclasses: {"path"=>"varchar_pattern_ops"}
2356
  add_index "routes", ["source_type", "source_id"], name: "index_routes_on_source_type_and_source_id", unique: true, using: :btree
2357

2358 2359 2360 2361 2362 2363 2364 2365 2366
  create_table "saml_providers", force: :cascade do |t|
    t.integer "group_id", null: false
    t.boolean "enabled", null: false
    t.string "certificate_fingerprint", null: false
    t.string "sso_url", null: false
  end

  add_index "saml_providers", ["group_id"], name: "index_saml_providers_on_group_id", using: :btree

Valery Sizov's avatar
Valery Sizov committed
2367
  create_table "sent_notifications", force: :cascade do |t|
Douwe Maan's avatar
Douwe Maan committed
2368 2369
    t.integer "project_id"
    t.integer "noteable_id"
2370
    t.string "noteable_type"
Douwe Maan's avatar
Douwe Maan committed
2371
    t.integer "recipient_id"
2372 2373 2374 2375 2376
    t.string "commit_id"
    t.string "reply_key", null: false
    t.string "line_code"
    t.string "note_type"
    t.text "position"
2377
    t.string "in_reply_to_discussion_id"
Douwe Maan's avatar
Douwe Maan committed
2378 2379 2380 2381
  end

  add_index "sent_notifications", ["reply_key"], name: "index_sent_notifications_on_reply_key", unique: true, using: :btree

Valery Sizov's avatar
Valery Sizov committed
2382
  create_table "services", force: :cascade do |t|
2383 2384 2385
    t.string "type"
    t.string "title"
    t.integer "project_id"
2386 2387
    t.datetime "created_at"
    t.datetime "updated_at"
2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400
    t.boolean "active", default: false, null: false
    t.text "properties"
    t.boolean "template", default: false
    t.boolean "push_events", default: true
    t.boolean "issues_events", default: true
    t.boolean "merge_requests_events", default: true
    t.boolean "tag_push_events", default: true
    t.boolean "note_events", default: true, null: false
    t.string "category", default: "common", null: false
    t.boolean "default", default: false
    t.boolean "wiki_page_events", default: true
    t.boolean "pipeline_events", default: false, null: false
    t.boolean "confidential_issues_events", default: true, null: false
2401
    t.boolean "commit_events", default: true, null: false
2402
    t.boolean "job_events", default: false, null: false
2403
    t.boolean "confidential_note_events", default: true
Andrew8xx8's avatar
Andrew8xx8 committed
2404 2405
  end

Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
2406
  add_index "services", ["project_id"], name: "index_services_on_project_id", using: :btree
2407
  add_index "services", ["template"], name: "index_services_on_template", using: :btree
Andrew8xx8's avatar
Andrew8xx8 committed
2408

Valery Sizov's avatar
Valery Sizov committed
2409 2410 2411 2412 2413 2414
  create_table "slack_integrations", force: :cascade do |t|
    t.integer "service_id", null: false
    t.string "team_id", null: false
    t.string "team_name", null: false
    t.string "alias", null: false
    t.string "user_id", null: false
2415 2416
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
Valery Sizov's avatar
Valery Sizov committed
2417 2418 2419
  end

  add_index "slack_integrations", ["service_id"], name: "index_slack_integrations_on_service_id", using: :btree
2420
  add_index "slack_integrations", ["team_id", "alias"], name: "index_slack_integrations_on_team_id_and_alias", unique: true, using: :btree
2421

Valery Sizov's avatar
Valery Sizov committed
2422
  create_table "snippets", force: :cascade do |t|
2423 2424 2425 2426
    t.string "title"
    t.text "content"
    t.integer "author_id", null: false
    t.integer "project_id"
2427 2428
    t.datetime "created_at"
    t.datetime "updated_at"
2429 2430 2431 2432 2433
    t.string "file_name"
    t.string "type"
    t.integer "visibility_level", default: 0, null: false
    t.text "title_html"
    t.text "content_html"
2434
    t.integer "cached_markdown_version"
2435 2436
    t.text "description"
    t.text "description_html"
Andrew8xx8's avatar
Andrew8xx8 committed
2437 2438
  end

Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
2439
  add_index "snippets", ["author_id"], name: "index_snippets_on_author_id", using: :btree
2440
  add_index "snippets", ["file_name"], name: "index_snippets_on_file_name_trigram", using: :gin, opclasses: {"file_name"=>"gin_trgm_ops"}
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
2441
  add_index "snippets", ["project_id"], name: "index_snippets_on_project_id", using: :btree
2442
  add_index "snippets", ["title"], name: "index_snippets_on_title_trigram", using: :gin, opclasses: {"title"=>"gin_trgm_ops"}
2443
  add_index "snippets", ["updated_at"], name: "index_snippets_on_updated_at", using: :btree
2444
  add_index "snippets", ["visibility_level"], name: "index_snippets_on_visibility_level", using: :btree
Andrew8xx8's avatar
Andrew8xx8 committed
2445

2446
  create_table "spam_logs", force: :cascade do |t|
2447 2448 2449 2450 2451 2452 2453 2454 2455 2456
    t.integer "user_id"
    t.string "source_ip"
    t.string "user_agent"
    t.boolean "via_api"
    t.string "noteable_type"
    t.string "title"
    t.text "description"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
    t.boolean "submitted_as_ham", default: false, null: false
2457
    t.boolean "recaptcha_verified", default: false, null: false
2458 2459
  end

Valery Sizov's avatar
Valery Sizov committed
2460
  create_table "subscriptions", force: :cascade do |t|
2461 2462 2463 2464
    t.integer "user_id"
    t.integer "subscribable_id"
    t.string "subscribable_type"
    t.boolean "subscribed"
Valery Sizov's avatar
Valery Sizov committed
2465 2466
    t.datetime "created_at"
    t.datetime "updated_at"
2467
    t.integer "project_id"
Valery Sizov's avatar
Valery Sizov committed
2468 2469
  end

2470
  add_index "subscriptions", ["subscribable_id", "subscribable_type", "user_id", "project_id"], name: "index_subscriptions_on_subscribable_and_user_id_and_project_id", unique: true, using: :btree
Valery Sizov's avatar
Valery Sizov committed
2471

2472 2473 2474
  create_table "system_note_metadata", force: :cascade do |t|
    t.integer "note_id", null: false
    t.integer "commit_count"
2475
    t.string "action"
2476 2477 2478 2479
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
  end

2480 2481
  add_index "system_note_metadata", ["note_id"], name: "index_system_note_metadata_on_note_id", unique: true, using: :btree

Valery Sizov's avatar
Valery Sizov committed
2482
  create_table "taggings", force: :cascade do |t|
2483 2484 2485 2486 2487 2488
    t.integer "tag_id"
    t.integer "taggable_id"
    t.string "taggable_type"
    t.integer "tagger_id"
    t.string "tagger_type"
    t.string "context"
Andrew8xx8's avatar
Andrew8xx8 committed
2489 2490 2491
    t.datetime "created_at"
  end

2492
  add_index "taggings", ["tag_id", "taggable_id", "taggable_type", "context", "tagger_id", "tagger_type"], name: "taggings_idx", unique: true, using: :btree
2493
  add_index "taggings", ["tag_id"], name: "index_taggings_on_tag_id", using: :btree
2494
  add_index "taggings", ["taggable_id", "taggable_type", "context"], name: "index_taggings_on_taggable_id_and_taggable_type_and_context", using: :btree
2495
  add_index "taggings", ["taggable_id", "taggable_type"], name: "index_taggings_on_taggable_id_and_taggable_type", using: :btree
2496

Valery Sizov's avatar
Valery Sizov committed
2497
  create_table "tags", force: :cascade do |t|
2498
    t.string "name"
Kamil Trzcinski's avatar
Kamil Trzcinski committed
2499
    t.integer "taggings_count", default: 0
Andrew8xx8's avatar
Andrew8xx8 committed
2500 2501
  end

2502 2503
  add_index "tags", ["name"], name: "index_tags_on_name", unique: true, using: :btree

2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515
  create_table "term_agreements", force: :cascade do |t|
    t.integer "term_id", null: false
    t.integer "user_id", null: false
    t.boolean "accepted", default: false, null: false
    t.datetime_with_timezone "created_at", null: false
    t.datetime_with_timezone "updated_at", null: false
  end

  add_index "term_agreements", ["term_id"], name: "index_term_agreements_on_term_id", using: :btree
  add_index "term_agreements", ["user_id", "term_id"], name: "term_agreements_unique_index", unique: true, using: :btree
  add_index "term_agreements", ["user_id"], name: "index_term_agreements_on_user_id", using: :btree

2516 2517
  create_table "timelogs", force: :cascade do |t|
    t.integer "time_spent", null: false
2518
    t.integer "user_id"
2519 2520
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
2521 2522
    t.integer "issue_id"
    t.integer "merge_request_id"
2523
    t.datetime "spent_at"
2524 2525
  end

2526 2527
  add_index "timelogs", ["issue_id"], name: "index_timelogs_on_issue_id", using: :btree
  add_index "timelogs", ["merge_request_id"], name: "index_timelogs_on_merge_request_id", using: :btree
2528
  add_index "timelogs", ["user_id"], name: "index_timelogs_on_user_id", using: :btree
2529

2530
  create_table "todos", force: :cascade do |t|
2531
    t.integer "user_id", null: false
2532
    t.integer "project_id", null: false
2533 2534
    t.integer "target_id"
    t.string "target_type", null: false
2535
    t.integer "author_id", null: false
2536 2537
    t.integer "action", null: false
    t.string "state", null: false
Douglas Barbosa Alexandre's avatar
Douglas Barbosa Alexandre committed
2538 2539
    t.datetime "created_at"
    t.datetime "updated_at"
2540 2541
    t.integer "note_id"
    t.string "commit_id"
Douglas Barbosa Alexandre's avatar
Douglas Barbosa Alexandre committed
2542 2543
  end

2544
  add_index "todos", ["author_id"], name: "index_todos_on_author_id", using: :btree
2545
  add_index "todos", ["commit_id"], name: "index_todos_on_commit_id", using: :btree
2546 2547 2548
  add_index "todos", ["note_id"], name: "index_todos_on_note_id", using: :btree
  add_index "todos", ["project_id"], name: "index_todos_on_project_id", using: :btree
  add_index "todos", ["target_type", "target_id"], name: "index_todos_on_target_type_and_target_id", using: :btree
2549 2550
  add_index "todos", ["user_id", "id"], name: "index_todos_on_user_id_and_id_done", where: "((state)::text = 'done'::text)", using: :btree
  add_index "todos", ["user_id", "id"], name: "index_todos_on_user_id_and_id_pending", where: "((state)::text = 'pending'::text)", using: :btree
2551
  add_index "todos", ["user_id"], name: "index_todos_on_user_id", using: :btree
Douglas Barbosa Alexandre's avatar
Douglas Barbosa Alexandre committed
2552

2553 2554 2555 2556
  create_table "trending_projects", force: :cascade do |t|
    t.integer "project_id", null: false
  end

2557
  add_index "trending_projects", ["project_id"], name: "index_trending_projects_on_project_id", unique: true, using: :btree
2558

2559
  create_table "u2f_registrations", force: :cascade do |t|
2560 2561 2562 2563 2564 2565 2566 2567
    t.text "certificate"
    t.string "key_handle"
    t.string "public_key"
    t.integer "counter"
    t.integer "user_id"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
    t.string "name"
2568 2569 2570 2571 2572
  end

  add_index "u2f_registrations", ["key_handle"], name: "index_u2f_registrations_on_key_handle", using: :btree
  add_index "u2f_registrations", ["user_id"], name: "index_u2f_registrations_on_user_id", using: :btree

2573 2574
  create_table "uploads", force: :cascade do |t|
    t.integer "size", limit: 8, null: false
2575
    t.string "path", limit: 511, null: false
2576 2577 2578 2579 2580
    t.string "checksum", limit: 64
    t.integer "model_id"
    t.string "model_type"
    t.string "uploader", null: false
    t.datetime "created_at", null: false
Micaël Bergeron's avatar
Micaël Bergeron committed
2581
    t.integer "store"
Micaël Bergeron's avatar
Micaël Bergeron committed
2582 2583
    t.string "mount_point"
    t.string "secret"
2584 2585 2586 2587
  end

  add_index "uploads", ["checksum"], name: "index_uploads_on_checksum", using: :btree
  add_index "uploads", ["model_id", "model_type"], name: "index_uploads_on_model_id_and_model_type", using: :btree
Micaël Bergeron's avatar
Micaël Bergeron committed
2588
  add_index "uploads", ["uploader", "path"], name: "index_uploads_on_uploader_and_path", using: :btree
2589

2590
  create_table "user_agent_details", force: :cascade do |t|
2591 2592 2593 2594 2595 2596 2597
    t.string "user_agent", null: false
    t.string "ip_address", null: false
    t.integer "subject_id", null: false
    t.string "subject_type", null: false
    t.boolean "submitted", default: false, null: false
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
2598 2599
  end

2600 2601
  add_index "user_agent_details", ["subject_id", "subject_type"], name: "index_user_agent_details_on_subject_id_and_subject_type", using: :btree

2602
  create_table "user_callouts", force: :cascade do |t|
2603
    t.integer "feature_name", null: false
2604 2605 2606 2607 2608 2609
    t.integer "user_id", null: false
  end

  add_index "user_callouts", ["user_id", "feature_name"], name: "index_user_callouts_on_user_id_and_feature_name", unique: true, using: :btree
  add_index "user_callouts", ["user_id"], name: "index_user_callouts_on_user_id", using: :btree

2610
  create_table "user_custom_attributes", force: :cascade do |t|
2611 2612
    t.datetime_with_timezone "created_at", null: false
    t.datetime_with_timezone "updated_at", null: false
2613 2614 2615 2616 2617 2618 2619 2620
    t.integer "user_id", null: false
    t.string "key", null: false
    t.string "value", null: false
  end

  add_index "user_custom_attributes", ["key", "value"], name: "index_user_custom_attributes_on_key_and_value", using: :btree
  add_index "user_custom_attributes", ["user_id", "key"], name: "index_user_custom_attributes_on_user_id_and_key", unique: true, using: :btree

2621 2622 2623 2624 2625 2626
  create_table "user_interacted_projects", id: false, force: :cascade do |t|
    t.integer "user_id", null: false
    t.integer "project_id", null: false
  end

  add_index "user_interacted_projects", ["project_id", "user_id"], name: "index_user_interacted_projects_on_project_id_and_user_id", unique: true, using: :btree
2627
  add_index "user_interacted_projects", ["user_id"], name: "index_user_interacted_projects_on_user_id", using: :btree
2628

2629 2630 2631 2632 2633 2634 2635 2636 2637 2638
  create_table "user_synced_attributes_metadata", force: :cascade do |t|
    t.boolean "name_synced", default: false
    t.boolean "email_synced", default: false
    t.boolean "location_synced", default: false
    t.integer "user_id", null: false
    t.string "provider"
  end

  add_index "user_synced_attributes_metadata", ["user_id"], name: "index_user_synced_attributes_metadata_on_user_id", unique: true, using: :btree

Valery Sizov's avatar
Valery Sizov committed
2639
  create_table "users", force: :cascade do |t|
2640 2641 2642
    t.string "email", default: "", null: false
    t.string "encrypted_password", default: "", null: false
    t.string "reset_password_token"
Andrew8xx8's avatar
Andrew8xx8 committed
2643 2644
    t.datetime "reset_password_sent_at"
    t.datetime "remember_created_at"
2645
    t.integer "sign_in_count", default: 0
Andrew8xx8's avatar
Andrew8xx8 committed
2646 2647
    t.datetime "current_sign_in_at"
    t.datetime "last_sign_in_at"
2648 2649
    t.string "current_sign_in_ip"
    t.string "last_sign_in_ip"
2650 2651
    t.datetime "created_at"
    t.datetime "updated_at"
2652 2653
    t.string "name"
    t.boolean "admin", default: false, null: false
2654
    t.integer "projects_limit", null: false
2655 2656 2657 2658 2659
    t.string "skype", default: "", null: false
    t.string "linkedin", default: "", null: false
    t.string "twitter", default: "", null: false
    t.string "bio"
    t.integer "failed_attempts", default: 0
Andrew8xx8's avatar
Andrew8xx8 committed
2660
    t.datetime "locked_at"
2661 2662 2663 2664 2665
    t.string "username"
    t.boolean "can_create_group", default: true, null: false
    t.boolean "can_create_team", default: true, null: false
    t.string "state"
    t.integer "color_scheme_id", default: 1, null: false
2666
    t.datetime "password_expires_at"
2667
    t.integer "created_by_id"
Kamil Trzcinski's avatar
Kamil Trzcinski committed
2668
    t.datetime "last_credential_check_at"
2669 2670
    t.string "avatar"
    t.string "confirmation_token"
2671 2672
    t.datetime "confirmed_at"
    t.datetime "confirmation_sent_at"
2673 2674 2675
    t.string "unconfirmed_email"
    t.boolean "hide_no_ssh_key", default: false
    t.string "website_url", default: "", null: false
Kamil Trzcinski's avatar
Kamil Trzcinski committed
2676
    t.datetime "admin_email_unsubscribed_at"
2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693
    t.string "notification_email"
    t.boolean "hide_no_password", default: false
    t.boolean "password_automatically_set", default: false
    t.string "location"
    t.string "encrypted_otp_secret"
    t.string "encrypted_otp_secret_iv"
    t.string "encrypted_otp_secret_salt"
    t.boolean "otp_required_for_login", default: false, null: false
    t.text "otp_backup_codes"
    t.string "public_email", default: "", null: false
    t.integer "dashboard", default: 0
    t.integer "project_view", default: 0
    t.integer "consumed_timestep"
    t.integer "layout", default: 0
    t.boolean "hide_project_limit", default: false
    t.text "note"
    t.string "unlock_token"
2694
    t.datetime "otp_grace_period_started_at"
2695
    t.boolean "external", default: false
Nick Thomas's avatar
Nick Thomas committed
2696
    t.string "incoming_email_token"
2697
    t.string "organization"
2698
    t.boolean "auditor", default: false, null: false
2699 2700
    t.boolean "require_two_factor_authentication_from_group", default: false, null: false
    t.integer "two_factor_grace_period", default: 48, null: false
2701
    t.boolean "ghost"
2702
    t.date "last_activity_on"
2703
    t.boolean "notified_of_own_activity"
2704
    t.boolean "support_bot"
2705
    t.string "preferred_language"
2706 2707
    t.boolean "email_opted_in"
    t.string "email_opted_in_ip"
2708
    t.integer "email_opted_in_source_id"
2709
    t.datetime "email_opted_in_at"
2710
    t.integer "theme_id", limit: 2
2711
    t.integer "accepted_term_id"
Micaël Bergeron's avatar
Micaël Bergeron committed
2712
    t.string "feed_token"
2713
    t.boolean "private_profile"
Andrew8xx8's avatar
Andrew8xx8 committed
2714 2715
  end

Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
2716
  add_index "users", ["admin"], name: "index_users_on_admin", using: :btree
Kamil Trzcinski's avatar
Kamil Trzcinski committed
2717
  add_index "users", ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true, using: :btree
2718
  add_index "users", ["created_at"], name: "index_users_on_created_at", using: :btree
Kamil Trzcinski's avatar
Kamil Trzcinski committed
2719
  add_index "users", ["email"], name: "index_users_on_email", unique: true, using: :btree
2720
  add_index "users", ["email"], name: "index_users_on_email_trigram", using: :gin, opclasses: {"email"=>"gin_trgm_ops"}
Micaël Bergeron's avatar
Micaël Bergeron committed
2721
  add_index "users", ["feed_token"], name: "index_users_on_feed_token", using: :btree
2722
  add_index "users", ["ghost"], name: "index_users_on_ghost", using: :btree
2723
  add_index "users", ["incoming_email_token"], name: "index_users_on_incoming_email_token", using: :btree
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
2724
  add_index "users", ["name"], name: "index_users_on_name", using: :btree
2725
  add_index "users", ["name"], name: "index_users_on_name_trigram", using: :gin, opclasses: {"name"=>"gin_trgm_ops"}
Kamil Trzcinski's avatar
Kamil Trzcinski committed
2726
  add_index "users", ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true, using: :btree
Stan Hu's avatar
Stan Hu committed
2727
  add_index "users", ["state"], name: "index_users_on_state", using: :btree
Micaël Bergeron's avatar
Micaël Bergeron committed
2728
  add_index "users", ["state"], name: "index_users_on_state_and_internal_attrs", where: "((ghost <> true) AND (support_bot <> true))", using: :btree
2729
  add_index "users", ["support_bot"], name: "index_users_on_support_bot", using: :btree
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
2730
  add_index "users", ["username"], name: "index_users_on_username", using: :btree
2731
  add_index "users", ["username"], name: "index_users_on_username_trigram", using: :gin, opclasses: {"username"=>"gin_trgm_ops"}
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
2732

Valery Sizov's avatar
Valery Sizov committed
2733
  create_table "users_star_projects", force: :cascade do |t|
2734 2735
    t.integer "project_id", null: false
    t.integer "user_id", null: false
Ciro Santilli's avatar
Ciro Santilli committed
2736 2737 2738 2739 2740 2741 2742
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "users_star_projects", ["project_id"], name: "index_users_star_projects_on_project_id", using: :btree
  add_index "users_star_projects", ["user_id", "project_id"], name: "index_users_star_projects_on_user_id_and_project_id", unique: true, using: :btree

2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759
  create_table "vulnerability_feedback", force: :cascade do |t|
    t.datetime_with_timezone "created_at", null: false
    t.datetime_with_timezone "updated_at", null: false
    t.integer "feedback_type", limit: 2, null: false
    t.integer "category", limit: 2, null: false
    t.integer "project_id", null: false
    t.integer "author_id", null: false
    t.integer "pipeline_id"
    t.integer "issue_id"
    t.string "project_fingerprint", limit: 40, null: false
  end

  add_index "vulnerability_feedback", ["author_id"], name: "index_vulnerability_feedback_on_author_id", using: :btree
  add_index "vulnerability_feedback", ["issue_id"], name: "index_vulnerability_feedback_on_issue_id", using: :btree
  add_index "vulnerability_feedback", ["pipeline_id"], name: "index_vulnerability_feedback_on_pipeline_id", using: :btree
  add_index "vulnerability_feedback", ["project_id", "category", "feedback_type", "project_fingerprint"], name: "vulnerability_feedback_unique_idx", unique: true, using: :btree

2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774
  create_table "web_hook_logs", force: :cascade do |t|
    t.integer "web_hook_id", null: false
    t.string "trigger"
    t.string "url"
    t.text "request_headers"
    t.text "request_data"
    t.text "response_headers"
    t.text "response_body"
    t.string "response_status"
    t.float "execution_duration"
    t.string "internal_error_message"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
  end

2775
  add_index "web_hook_logs", ["created_at", "web_hook_id"], name: "index_web_hook_logs_on_created_at_and_web_hook_id", using: :btree
2776 2777
  add_index "web_hook_logs", ["web_hook_id"], name: "index_web_hook_logs_on_web_hook_id", using: :btree

Valery Sizov's avatar
Valery Sizov committed
2778
  create_table "web_hooks", force: :cascade do |t|
2779 2780
    t.string "url", limit: 2000
    t.integer "project_id"
2781 2782
    t.datetime "created_at"
    t.datetime "updated_at"
2783 2784 2785 2786 2787 2788 2789 2790 2791
    t.string "type", default: "ProjectHook"
    t.integer "service_id"
    t.boolean "push_events", default: true, null: false
    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
2792
    t.boolean "wiki_page_events", default: false, null: false
2793
    t.string "token"
2794 2795
    t.boolean "pipeline_events", default: false, null: false
    t.boolean "confidential_issues_events", default: false, null: false
2796
    t.boolean "repository_update_events", default: false, null: false
Luke "Jared" Bennett's avatar
Luke "Jared" Bennett committed
2797
    t.boolean "job_events", default: false, null: false
2798
    t.boolean "confidential_note_events"
Andrew8xx8's avatar
Andrew8xx8 committed
2799 2800
  end

Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
2801
  add_index "web_hooks", ["project_id"], name: "index_web_hooks_on_project_id", using: :btree
2802
  add_index "web_hooks", ["type"], name: "index_web_hooks_on_type", using: :btree
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
2803

2804
  add_foreign_key "approvals", "merge_requests", name: "fk_310d714958", on_delete: :cascade
Valery Sizov's avatar
Valery Sizov committed
2805
  add_foreign_key "approver_groups", "namespaces", column: "group_id", on_delete: :cascade
2806 2807
  add_foreign_key "badges", "namespaces", column: "group_id", on_delete: :cascade
  add_foreign_key "badges", "projects", on_delete: :cascade
2808 2809
  add_foreign_key "board_assignees", "boards", on_delete: :cascade
  add_foreign_key "board_assignees", "users", column: "assignee_id", on_delete: :cascade
2810 2811
  add_foreign_key "board_labels", "boards", on_delete: :cascade
  add_foreign_key "board_labels", "labels", on_delete: :cascade
Felipe Artur's avatar
Felipe Artur committed
2812
  add_foreign_key "boards", "namespaces", column: "group_id", name: "fk_1e9a074a35", on_delete: :cascade
2813
  add_foreign_key "boards", "projects", name: "fk_f15266b5f9", on_delete: :cascade
2814
  add_foreign_key "chat_teams", "namespaces", on_delete: :cascade
2815
  add_foreign_key "ci_build_trace_chunks", "ci_builds", column: "build_id", on_delete: :cascade
2816 2817 2818 2819
  add_foreign_key "ci_build_trace_section_names", "projects", on_delete: :cascade
  add_foreign_key "ci_build_trace_sections", "ci_build_trace_section_names", column: "section_name_id", name: "fk_264e112c66", on_delete: :cascade
  add_foreign_key "ci_build_trace_sections", "ci_builds", column: "build_id", name: "fk_4ebe41f502", on_delete: :cascade
  add_foreign_key "ci_build_trace_sections", "projects", on_delete: :cascade
2820
  add_foreign_key "ci_builds", "ci_pipelines", column: "auto_canceled_by_id", name: "fk_a2141b1522", on_delete: :nullify
2821
  add_foreign_key "ci_builds", "ci_pipelines", column: "commit_id", name: "fk_d3130c9a7f", on_delete: :cascade
2822
  add_foreign_key "ci_builds", "ci_stages", column: "stage_id", name: "fk_3a9eaa254d", on_delete: :cascade
2823
  add_foreign_key "ci_builds", "projects", name: "fk_befce0568a", on_delete: :cascade
2824 2825
  add_foreign_key "ci_builds_metadata", "ci_builds", column: "build_id", on_delete: :cascade
  add_foreign_key "ci_builds_metadata", "projects", on_delete: :cascade
2826
  add_foreign_key "ci_builds_runner_session", "ci_builds", column: "build_id", on_delete: :cascade
Shinya Maeda's avatar
Shinya Maeda committed
2827
  add_foreign_key "ci_group_variables", "namespaces", column: "group_id", name: "fk_33ae4d58d8", on_delete: :cascade
2828 2829
  add_foreign_key "ci_job_artifacts", "ci_builds", column: "job_id", on_delete: :cascade
  add_foreign_key "ci_job_artifacts", "projects", on_delete: :cascade
2830 2831
  add_foreign_key "ci_pipeline_chat_data", "chat_names", on_delete: :cascade
  add_foreign_key "ci_pipeline_chat_data", "ci_pipelines", column: "pipeline_id", on_delete: :cascade
Shinya Maeda's avatar
fix  
Shinya Maeda committed
2832
  add_foreign_key "ci_pipeline_schedule_variables", "ci_pipeline_schedules", column: "pipeline_schedule_id", name: "fk_41c35fda51", on_delete: :cascade
2833
  add_foreign_key "ci_pipeline_schedules", "projects", name: "fk_8ead60fcc4", on_delete: :cascade
2834
  add_foreign_key "ci_pipeline_schedules", "users", column: "owner_id", name: "fk_9ea99f58d2", on_delete: :nullify
2835
  add_foreign_key "ci_pipeline_variables", "ci_pipelines", column: "pipeline_id", name: "fk_f29c5f4380", on_delete: :cascade
Kamil Trzcinski's avatar
Kamil Trzcinski committed
2836 2837
  add_foreign_key "ci_pipelines", "ci_pipeline_schedules", column: "pipeline_schedule_id", name: "fk_3d34ab2e06", on_delete: :nullify
  add_foreign_key "ci_pipelines", "ci_pipelines", column: "auto_canceled_by_id", name: "fk_262d4c2d19", on_delete: :nullify
2838
  add_foreign_key "ci_pipelines", "projects", name: "fk_86635dbd80", on_delete: :cascade
2839
  add_foreign_key "ci_runner_namespaces", "ci_runners", column: "runner_id", on_delete: :cascade
2840
  add_foreign_key "ci_runner_namespaces", "namespaces", on_delete: :cascade
2841
  add_foreign_key "ci_runner_projects", "projects", name: "fk_4478a6f1e4", on_delete: :cascade
2842 2843 2844 2845 2846
  add_foreign_key "ci_sources_pipelines", "ci_builds", column: "source_job_id", name: "fk_be5624bf37", on_delete: :cascade
  add_foreign_key "ci_sources_pipelines", "ci_pipelines", column: "pipeline_id", name: "fk_e1bad85861", on_delete: :cascade
  add_foreign_key "ci_sources_pipelines", "ci_pipelines", column: "source_pipeline_id", name: "fk_d4e29af7d7", on_delete: :cascade
  add_foreign_key "ci_sources_pipelines", "projects", column: "source_project_id", name: "fk_acd9737679", on_delete: :cascade
  add_foreign_key "ci_sources_pipelines", "projects", name: "fk_1e53c97c0a", on_delete: :cascade
2847
  add_foreign_key "ci_stages", "ci_pipelines", column: "pipeline_id", name: "fk_fb57e6cc56", on_delete: :cascade
2848
  add_foreign_key "ci_stages", "projects", name: "fk_2360681d1d", on_delete: :cascade
2849
  add_foreign_key "ci_trigger_requests", "ci_triggers", column: "trigger_id", name: "fk_b8ec8b7245", on_delete: :cascade
2850
  add_foreign_key "ci_triggers", "projects", name: "fk_e3e63f966e", on_delete: :cascade
2851
  add_foreign_key "ci_triggers", "users", column: "owner_id", name: "fk_e8e10d1964", on_delete: :cascade
2852
  add_foreign_key "ci_variables", "projects", name: "fk_ada5eb64b3", on_delete: :cascade
Shinya Maeda's avatar
Shinya Maeda committed
2853 2854 2855 2856 2857
  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_gcp", "clusters", on_delete: :cascade
  add_foreign_key "clusters", "users", on_delete: :nullify
2858
  add_foreign_key "clusters_applications_helm", "clusters", on_delete: :cascade
2859
  add_foreign_key "clusters_applications_ingress", "clusters", name: "fk_753a7b41c1", on_delete: :cascade
Micaël Bergeron's avatar
Micaël Bergeron committed
2860 2861
  add_foreign_key "clusters_applications_jupyter", "clusters", on_delete: :cascade
  add_foreign_key "clusters_applications_jupyter", "oauth_applications", on_delete: :nullify
2862
  add_foreign_key "clusters_applications_prometheus", "clusters", name: "fk_557e773639", on_delete: :cascade
2863 2864
  add_foreign_key "clusters_applications_runners", "ci_runners", column: "runner_id", name: "fk_02de2ded36", on_delete: :nullify
  add_foreign_key "clusters_applications_runners", "clusters", on_delete: :cascade
Valery Sizov's avatar
Valery Sizov committed
2865
  add_foreign_key "container_repositories", "projects"
2866 2867 2868
  add_foreign_key "deploy_keys_projects", "projects", name: "fk_58a901ca7e", on_delete: :cascade
  add_foreign_key "deployments", "projects", name: "fk_b9a3851b82", on_delete: :cascade
  add_foreign_key "environments", "projects", name: "fk_d1c8c1da6a", on_delete: :cascade
2869 2870
  add_foreign_key "epic_issues", "epics", on_delete: :cascade
  add_foreign_key "epic_issues", "issues", on_delete: :cascade
Clement Ho's avatar
Clement Ho committed
2871 2872 2873 2874 2875
  add_foreign_key "epic_metrics", "epics", on_delete: :cascade
  add_foreign_key "epics", "milestones", on_delete: :nullify
  add_foreign_key "epics", "namespaces", column: "group_id", name: "fk_f081aa4489", on_delete: :cascade
  add_foreign_key "epics", "users", column: "assignee_id", name: "fk_dccd3f98fc", on_delete: :nullify
  add_foreign_key "epics", "users", column: "author_id", name: "fk_3654b61b03", on_delete: :cascade
2876 2877
  add_foreign_key "events", "projects", on_delete: :cascade
  add_foreign_key "events", "users", column: "author_id", name: "fk_edfd187b6f", on_delete: :cascade
2878 2879 2880
  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
  add_foreign_key "fork_network_members", "projects", on_delete: :cascade
2881
  add_foreign_key "fork_networks", "projects", column: "root_project_id", name: "fk_e7b436b2b5", on_delete: :nullify
2882
  add_foreign_key "forked_project_links", "projects", column: "forked_to_project_id", name: "fk_434510edb0", on_delete: :cascade
2883 2884 2885
  add_foreign_key "gcp_clusters", "projects", on_delete: :cascade
  add_foreign_key "gcp_clusters", "services", on_delete: :nullify
  add_foreign_key "gcp_clusters", "users", on_delete: :nullify
2886
  add_foreign_key "geo_event_log", "geo_hashed_storage_migrated_events", column: "hashed_storage_migrated_event_id", name: "fk_27548c6db3", on_delete: :cascade
2887
  add_foreign_key "geo_event_log", "geo_job_artifact_deleted_events", column: "job_artifact_deleted_event_id", name: "fk_176d3fbb5d", on_delete: :cascade
2888
  add_foreign_key "geo_event_log", "geo_lfs_object_deleted_events", column: "lfs_object_deleted_event_id", name: "fk_d5af95fcd9", on_delete: :cascade
2889
  add_foreign_key "geo_event_log", "geo_repositories_changed_events", column: "repositories_changed_event_id", name: "fk_4a99ebfd60", on_delete: :cascade
2890
  add_foreign_key "geo_event_log", "geo_repository_created_events", column: "repository_created_event_id", name: "fk_9b9afb1916", on_delete: :cascade
Stan Hu's avatar
Stan Hu committed
2891
  add_foreign_key "geo_event_log", "geo_repository_deleted_events", column: "repository_deleted_event_id", name: "fk_c4b1c1f66e", on_delete: :cascade
2892
  add_foreign_key "geo_event_log", "geo_repository_renamed_events", column: "repository_renamed_event_id", name: "fk_86c84214ec", on_delete: :cascade
2893
  add_foreign_key "geo_event_log", "geo_repository_updated_events", column: "repository_updated_event_id", on_delete: :cascade
2894
  add_foreign_key "geo_event_log", "geo_upload_deleted_events", column: "upload_deleted_event_id", name: "fk_c1f241c70d", on_delete: :cascade
2895
  add_foreign_key "geo_hashed_storage_attachments_events", "projects", on_delete: :cascade
2896
  add_foreign_key "geo_hashed_storage_migrated_events", "projects", on_delete: :cascade
2897
  add_foreign_key "geo_node_namespace_links", "geo_nodes", on_delete: :cascade
2898
  add_foreign_key "geo_node_namespace_links", "namespaces", on_delete: :cascade
2899
  add_foreign_key "geo_node_statuses", "geo_nodes", on_delete: :cascade
2900
  add_foreign_key "geo_repositories_changed_events", "geo_nodes", on_delete: :cascade
2901
  add_foreign_key "geo_repository_created_events", "projects", on_delete: :cascade
2902
  add_foreign_key "geo_repository_renamed_events", "projects", on_delete: :cascade
2903
  add_foreign_key "geo_repository_updated_events", "projects", on_delete: :cascade
2904
  add_foreign_key "gpg_key_subkeys", "gpg_keys", on_delete: :cascade
2905
  add_foreign_key "gpg_keys", "users", on_delete: :cascade
2906
  add_foreign_key "gpg_signatures", "gpg_key_subkeys", on_delete: :nullify
2907 2908
  add_foreign_key "gpg_signatures", "gpg_keys", on_delete: :nullify
  add_foreign_key "gpg_signatures", "projects", on_delete: :cascade
2909
  add_foreign_key "group_custom_attributes", "namespaces", column: "group_id", on_delete: :cascade
2910
  add_foreign_key "identities", "saml_providers", name: "fk_aade90f0fc", on_delete: :cascade
2911
  add_foreign_key "import_export_uploads", "projects", on_delete: :cascade
2912
  add_foreign_key "index_statuses", "projects", name: "fk_74b2492545", on_delete: :cascade
2913
  add_foreign_key "internal_ids", "namespaces", name: "fk_162941d509", on_delete: :cascade
2914
  add_foreign_key "internal_ids", "projects", on_delete: :cascade
2915 2916
  add_foreign_key "issue_assignees", "issues", name: "fk_b7d881734a", on_delete: :cascade
  add_foreign_key "issue_assignees", "users", name: "fk_5e0c8d9154", on_delete: :cascade
2917 2918
  add_foreign_key "issue_links", "issues", column: "source_id", name: "fk_c900194ff2", on_delete: :cascade
  add_foreign_key "issue_links", "issues", column: "target_id", name: "fk_e71bb44f1f", on_delete: :cascade
2919
  add_foreign_key "issue_metrics", "issues", on_delete: :cascade
2920 2921
  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
2922
  add_foreign_key "issues", "projects", name: "fk_899c8f3231", on_delete: :cascade
2923
  add_foreign_key "issues", "users", column: "author_id", name: "fk_05f1e72feb", on_delete: :nullify
haseeb's avatar
haseeb committed
2924
  add_foreign_key "issues", "users", column: "closed_by_id", name: "fk_c63cbf6c25", on_delete: :nullify
2925
  add_foreign_key "issues", "users", column: "updated_by_id", name: "fk_ffed080f01", on_delete: :nullify
2926 2927
  add_foreign_key "label_priorities", "labels", on_delete: :cascade
  add_foreign_key "label_priorities", "projects", on_delete: :cascade
2928
  add_foreign_key "labels", "namespaces", column: "group_id", on_delete: :cascade
2929
  add_foreign_key "labels", "projects", name: "fk_7de4989a69", on_delete: :cascade
2930 2931
  add_foreign_key "lfs_file_locks", "projects", on_delete: :cascade
  add_foreign_key "lfs_file_locks", "users", on_delete: :cascade
2932 2933
  add_foreign_key "lists", "boards", name: "fk_0d3f677137", on_delete: :cascade
  add_foreign_key "lists", "labels", name: "fk_7a5553d60f", on_delete: :cascade
2934
  add_foreign_key "lists", "users", name: "fk_d6cf4279f7", on_delete: :cascade
2935
  add_foreign_key "members", "users", name: "fk_2e88fb7ce9", on_delete: :cascade
2936
  add_foreign_key "merge_request_diff_commits", "merge_request_diffs", on_delete: :cascade
2937
  add_foreign_key "merge_request_diff_files", "merge_request_diffs", on_delete: :cascade
2938
  add_foreign_key "merge_request_diffs", "merge_requests", name: "fk_8483f3258f", on_delete: :cascade
2939
  add_foreign_key "merge_request_metrics", "ci_pipelines", column: "pipeline_id", on_delete: :cascade
2940
  add_foreign_key "merge_request_metrics", "merge_requests", on_delete: :cascade
2941 2942
  add_foreign_key "merge_request_metrics", "users", column: "latest_closed_by_id", name: "fk_ae440388cc", on_delete: :nullify
  add_foreign_key "merge_request_metrics", "users", column: "merged_by_id", name: "fk_7f28d925f3", on_delete: :nullify
2943
  add_foreign_key "merge_requests", "ci_pipelines", column: "head_pipeline_id", name: "fk_fd82eae0b9", on_delete: :nullify
2944
  add_foreign_key "merge_requests", "merge_request_diffs", column: "latest_merge_request_diff_id", name: "fk_06067f5644", on_delete: :nullify
2945 2946
  add_foreign_key "merge_requests", "milestones", name: "fk_6a5165a692", on_delete: :nullify
  add_foreign_key "merge_requests", "projects", column: "source_project_id", name: "fk_3308fe130c", on_delete: :nullify
2947
  add_foreign_key "merge_requests", "projects", column: "target_project_id", name: "fk_a6963e8447", on_delete: :cascade
2948 2949 2950 2951
  add_foreign_key "merge_requests", "users", column: "assignee_id", name: "fk_6149611a04", on_delete: :nullify
  add_foreign_key "merge_requests", "users", column: "author_id", name: "fk_e719a85f8a", on_delete: :nullify
  add_foreign_key "merge_requests", "users", column: "merge_user_id", name: "fk_ad525e1f87", on_delete: :nullify
  add_foreign_key "merge_requests", "users", column: "updated_by_id", name: "fk_641731faff", on_delete: :nullify
2952 2953
  add_foreign_key "merge_requests_closing_issues", "issues", on_delete: :cascade
  add_foreign_key "merge_requests_closing_issues", "merge_requests", on_delete: :cascade
Felipe Artur's avatar
Felipe Artur committed
2954
  add_foreign_key "milestones", "namespaces", column: "group_id", name: "fk_95650a40d4", on_delete: :cascade
2955
  add_foreign_key "milestones", "projects", name: "fk_9bd0a0c791", on_delete: :cascade
2956
  add_foreign_key "namespace_statistics", "namespaces", on_delete: :cascade
2957
  add_foreign_key "namespaces", "plans", name: "fk_fdd12e5b80", on_delete: :nullify
2958
  add_foreign_key "note_diff_files", "notes", column: "diff_note_id", on_delete: :cascade
2959
  add_foreign_key "notes", "projects", name: "fk_99e097b079", on_delete: :cascade
Nick Thomas's avatar
Nick Thomas committed
2960
  add_foreign_key "oauth_openid_requests", "oauth_access_grants", column: "access_grant_id", name: "fk_oauth_openid_requests_oauth_access_grants_access_grant_id"
2961
  add_foreign_key "pages_domains", "projects", name: "fk_ea2f6dfc6f", on_delete: :cascade
2962
  add_foreign_key "path_locks", "projects", name: "fk_5265c98f24", on_delete: :cascade
Valery Sizov's avatar
Valery Sizov committed
2963
  add_foreign_key "path_locks", "users"
2964
  add_foreign_key "personal_access_tokens", "users"
2965 2966
  add_foreign_key "project_authorizations", "projects", on_delete: :cascade
  add_foreign_key "project_authorizations", "users", on_delete: :cascade
2967
  add_foreign_key "project_auto_devops", "projects", on_delete: :cascade
2968
  add_foreign_key "project_ci_cd_settings", "projects", name: "fk_24c15d2f2e", on_delete: :cascade
2969
  add_foreign_key "project_custom_attributes", "projects", on_delete: :cascade
2970 2971
  add_foreign_key "project_deploy_tokens", "deploy_tokens", on_delete: :cascade
  add_foreign_key "project_deploy_tokens", "projects", on_delete: :cascade
2972 2973 2974
  add_foreign_key "project_features", "projects", name: "fk_18513d9b92", on_delete: :cascade
  add_foreign_key "project_group_links", "projects", name: "fk_daa8cee94c", on_delete: :cascade
  add_foreign_key "project_import_data", "projects", name: "fk_ffb9ee3a10", on_delete: :cascade
2975
  add_foreign_key "project_mirror_data", "projects", name: "fk_d1aad367d7", on_delete: :cascade
2976
  add_foreign_key "project_repository_states", "projects", on_delete: :cascade
2977
  add_foreign_key "project_statistics", "projects", on_delete: :cascade
2978
  add_foreign_key "prometheus_metrics", "projects", on_delete: :cascade
2979
  add_foreign_key "protected_branch_merge_access_levels", "namespaces", column: "group_id", name: "fk_98f3d044fe", on_delete: :cascade
2980
  add_foreign_key "protected_branch_merge_access_levels", "protected_branches", name: "fk_8a3072ccb3", on_delete: :cascade
2981
  add_foreign_key "protected_branch_merge_access_levels", "users"
2982
  add_foreign_key "protected_branch_push_access_levels", "namespaces", column: "group_id", name: "fk_7111b68cdb", on_delete: :cascade
2983
  add_foreign_key "protected_branch_push_access_levels", "protected_branches", name: "fk_9ffc86a3d9", on_delete: :cascade
2984
  add_foreign_key "protected_branch_push_access_levels", "users"
2985 2986 2987
  add_foreign_key "protected_branch_unprotect_access_levels", "namespaces", column: "group_id", on_delete: :cascade
  add_foreign_key "protected_branch_unprotect_access_levels", "protected_branches", on_delete: :cascade
  add_foreign_key "protected_branch_unprotect_access_levels", "users", on_delete: :cascade
2988
  add_foreign_key "protected_branches", "projects", name: "fk_7a9c6d93e7", on_delete: :cascade
2989
  add_foreign_key "protected_tag_create_access_levels", "namespaces", column: "group_id", name: "fk_b4eb82fe3c", on_delete: :cascade
2990
  add_foreign_key "protected_tag_create_access_levels", "protected_tags", name: "fk_f7dfda8c51", on_delete: :cascade
2991
  add_foreign_key "protected_tag_create_access_levels", "users"
2992
  add_foreign_key "protected_tags", "projects", name: "fk_8e4af87648", on_delete: :cascade
2993
  add_foreign_key "push_event_payloads", "events", name: "fk_36c74129da", on_delete: :cascade
Rémy Coutable's avatar
Rémy Coutable committed
2994
  add_foreign_key "push_rules", "projects", name: "fk_83b29894de", on_delete: :cascade
2995
  add_foreign_key "releases", "projects", name: "fk_47fe2a0596", on_delete: :cascade
2996
  add_foreign_key "remote_mirrors", "projects", name: "fk_43a9aa4ca8", on_delete: :cascade
2997
  add_foreign_key "saml_providers", "namespaces", column: "group_id", on_delete: :cascade
2998
  add_foreign_key "services", "projects", name: "fk_71cce407f9", on_delete: :cascade
Valery Sizov's avatar
Valery Sizov committed
2999
  add_foreign_key "slack_integrations", "services", on_delete: :cascade
3000
  add_foreign_key "snippets", "projects", name: "fk_be41fd4bb7", on_delete: :cascade
3001
  add_foreign_key "subscriptions", "projects", on_delete: :cascade
3002
  add_foreign_key "system_note_metadata", "notes", name: "fk_d83a918cb1", on_delete: :cascade
3003 3004
  add_foreign_key "term_agreements", "application_setting_terms", column: "term_id"
  add_foreign_key "term_agreements", "users", on_delete: :cascade
3005 3006
  add_foreign_key "timelogs", "issues", name: "fk_timelogs_issues_issue_id", on_delete: :cascade
  add_foreign_key "timelogs", "merge_requests", name: "fk_timelogs_merge_requests_merge_request_id", on_delete: :cascade
3007
  add_foreign_key "todos", "notes", name: "fk_91d1f47b13", on_delete: :cascade
3008
  add_foreign_key "todos", "projects", name: "fk_45054f9c45", on_delete: :cascade
3009 3010
  add_foreign_key "todos", "users", column: "author_id", name: "fk_ccf0373936", on_delete: :cascade
  add_foreign_key "todos", "users", name: "fk_d94154aa95", on_delete: :cascade
3011
  add_foreign_key "trending_projects", "projects", on_delete: :cascade
3012
  add_foreign_key "u2f_registrations", "users"
3013
  add_foreign_key "user_callouts", "users", on_delete: :cascade
3014
  add_foreign_key "user_custom_attributes", "users", on_delete: :cascade
3015 3016
  add_foreign_key "user_interacted_projects", "projects", name: "fk_722ceba4f7", on_delete: :cascade
  add_foreign_key "user_interacted_projects", "users", name: "fk_0894651f08", on_delete: :cascade
3017
  add_foreign_key "user_synced_attributes_metadata", "users", on_delete: :cascade
3018
  add_foreign_key "users", "application_setting_terms", column: "accepted_term_id", name: "fk_789cd90b35", on_delete: :cascade
3019
  add_foreign_key "users_star_projects", "projects", name: "fk_22cd27ddfc", on_delete: :cascade
3020 3021 3022 3023
  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", "projects", on_delete: :cascade
  add_foreign_key "vulnerability_feedback", "users", column: "author_id", on_delete: :cascade
3024
  add_foreign_key "web_hook_logs", "web_hooks", on_delete: :cascade
3025
  add_foreign_key "web_hooks", "projects", name: "fk_0c8ca6d9d1", on_delete: :cascade
3026
end