schema.rb 125 KB
Newer Older
Andrew8xx8's avatar
Andrew8xx8 committed
1 2 3 4 5 6 7 8 9 10
# 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
11
# It's strongly recommended that you check this file into your version control system.
Andrew8xx8's avatar
Andrew8xx8 committed
12

13
ActiveRecord::Schema.define(version: 20190301081611) do
14

Kamil Trzcinski's avatar
Kamil Trzcinski committed
15 16
  # These are extensions that must be enabled in order to support this database
  enable_extension "plpgsql"
17
  enable_extension "pg_trgm"
Kamil Trzcinski's avatar
Kamil Trzcinski committed
18

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

29
  create_table "appearances", force: :cascade do |t|
30 31
    t.string "title", null: false
    t.text "description", null: false
32 33
    t.string "header_logo"
    t.string "logo"
34 35
    t.datetime_with_timezone "created_at", null: false
    t.datetime_with_timezone "updated_at", null: false
36
    t.text "description_html"
37
    t.integer "cached_markdown_version"
38 39
    t.text "new_project_guidelines"
    t.text "new_project_guidelines_html"
40 41 42 43 44 45
    t.text "header_message"
    t.text "header_message_html"
    t.text "footer_message"
    t.text "footer_message_html"
    t.text "message_background_color"
    t.text "message_font_color"
46
    t.string "favicon"
47
    t.boolean "email_header_and_footer_enabled", default: false, null: false
48 49
  end

50 51 52 53 54 55
  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
56
  create_table "application_settings", force: :cascade do |t|
57 58 59 60
    t.integer "default_projects_limit"
    t.boolean "signup_enabled"
    t.boolean "gravatar_enabled"
    t.text "sign_in_text"
61 62
    t.datetime "created_at"
    t.datetime "updated_at"
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
    t.string "home_page_url"
    t.integer "default_branch_protection", default: 2
    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"
80
    t.integer "max_pages_size", default: 100, null: false
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
    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"
Valery Sizov's avatar
Valery Sizov committed
107
    t.boolean "user_default_external", default: false, null: false
108
    t.string "repository_storages", default: "default"
109 110 111
    t.string "enabled_git_access_protocol"
    t.boolean "domain_blacklist_enabled", default: false
    t.text "domain_blacklist"
112
    t.boolean "usage_ping_enabled", default: true, null: false
113 114 115 116
    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"
117
    t.integer "rsa_key_restriction", default: 0, null: false
118
    t.integer "dsa_key_restriction", default: -1, null: false
119 120
    t.integer "ecdsa_key_restriction", default: 0, null: false
    t.integer "ed25519_key_restriction", default: 0, null: false
121 122 123 124 125
    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
126
    t.boolean "html_emails_enabled", default: true
127 128
    t.string "plantuml_url"
    t.boolean "plantuml_enabled"
129
    t.integer "terminal_max_session_time", default: 0, null: false
130 131 132
    t.integer "unique_ips_limit_per_user"
    t.integer "unique_ips_limit_time_window"
    t.boolean "unique_ips_limit_enabled", default: false, null: false
133 134
    t.string "default_artifacts_expire_in", default: "0", null: false
    t.string "uuid"
135
    t.decimal "polling_interval_multiplier", default: "1.0", null: false
136
    t.integer "cached_markdown_version"
137 138
    t.boolean "clientside_sentry_enabled", default: false, null: false
    t.string "clientside_sentry_dsn"
139
    t.boolean "prometheus_metrics_enabled", default: true, null: false
140 141
    t.boolean "help_page_hide_commercial_content", default: false
    t.string "help_page_support_url"
142
    t.integer "performance_bar_allowed_group_id"
143
    t.boolean "hashed_storage_enabled", default: false, null: false
144
    t.boolean "project_export_enabled", default: true, null: false
145
    t.boolean "auto_devops_enabled", default: true, null: false
146 147 148 149 150 151 152 153 154
    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
155 156
    t.boolean "password_authentication_enabled_for_web"
    t.boolean "password_authentication_enabled_for_git", default: true
157 158 159
    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
160
    t.boolean "authorized_keys_enabled", default: true, null: false
161
    t.string "auto_devops_domain"
162
    t.boolean "pages_domain_verification_enabled", default: true, null: false
163
    t.string "user_default_internal_regex"
164
    t.boolean "allow_local_requests_from_hooks_and_services", default: false, null: false
165
    t.boolean "enforce_terms", default: false
166
    t.boolean "mirror_available", default: true, null: false
167
    t.boolean "hide_third_party_offers", default: false, null: false
168
    t.boolean "instance_statistics_visibility_private", default: false, null: false
Phil Hughes's avatar
Phil Hughes committed
169
    t.boolean "web_ide_clientside_preview_enabled", default: false, null: false
170
    t.boolean "user_show_add_ssh_key_message", default: true, null: false
171
    t.integer "usage_stats_set_by_user_id"
172
    t.integer "receive_max_input_size"
173
    t.integer "diff_max_patch_bytes", default: 102400, null: false
174
    t.integer "archive_builds_in_seconds"
175
    t.string "commit_email_hostname"
176
    t.boolean "protected_ci_variables", default: false, null: false
177
    t.string "runners_registration_token_encrypted"
178
    t.integer "local_markdown_version", default: 0, null: false
179
    t.integer "first_day_of_week", default: 0, null: false
180
    t.index ["usage_stats_set_by_user_id"], name: "index_application_settings_on_usage_stats_set_by_user_id", using: :btree
181 182
  end

Valery Sizov's avatar
Valery Sizov committed
183
  create_table "audit_events", force: :cascade do |t|
184 185 186 187 188
    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"
189 190
    t.datetime "created_at"
    t.datetime "updated_at"
191
    t.index ["entity_id", "entity_type"], name: "index_audit_events_on_entity_id_and_entity_type", using: :btree
192 193
  end

194
  create_table "award_emoji", force: :cascade do |t|
195 196 197 198
    t.string "name"
    t.integer "user_id"
    t.integer "awardable_id"
    t.string "awardable_type"
199 200
    t.datetime "created_at"
    t.datetime "updated_at"
201 202
    t.index ["awardable_type", "awardable_id"], name: "index_award_emoji_on_awardable_type_and_awardable_id", using: :btree
    t.index ["user_id", "name"], name: "index_award_emoji_on_user_id_and_name", using: :btree
203 204
  end

205 206 207 208 209 210 211 212
  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
213 214
    t.index ["group_id"], name: "index_badges_on_group_id", using: :btree
    t.index ["project_id"], name: "index_badges_on_project_id", using: :btree
215 216
  end

217 218 219 220 221 222
  create_table "board_group_recent_visits", id: :bigserial, force: :cascade do |t|
    t.datetime_with_timezone "created_at", null: false
    t.datetime_with_timezone "updated_at", null: false
    t.integer "user_id"
    t.integer "board_id"
    t.integer "group_id"
223 224 225 226
    t.index ["board_id"], name: "index_board_group_recent_visits_on_board_id", using: :btree
    t.index ["group_id"], name: "index_board_group_recent_visits_on_group_id", using: :btree
    t.index ["user_id", "group_id", "board_id"], name: "index_board_group_recent_visits_on_user_group_and_board", unique: true, using: :btree
    t.index ["user_id"], name: "index_board_group_recent_visits_on_user_id", using: :btree
227 228 229 230 231 232 233 234
  end

  create_table "board_project_recent_visits", id: :bigserial, force: :cascade do |t|
    t.datetime_with_timezone "created_at", null: false
    t.datetime_with_timezone "updated_at", null: false
    t.integer "user_id"
    t.integer "project_id"
    t.integer "board_id"
235 236 237 238
    t.index ["board_id"], name: "index_board_project_recent_visits_on_board_id", using: :btree
    t.index ["project_id"], name: "index_board_project_recent_visits_on_project_id", using: :btree
    t.index ["user_id", "project_id", "board_id"], name: "index_board_project_recent_visits_on_user_project_and_board", unique: true, using: :btree
    t.index ["user_id"], name: "index_board_project_recent_visits_on_user_id", using: :btree
239 240
  end

241
  create_table "boards", force: :cascade do |t|
242
    t.integer "project_id"
243 244
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
245
    t.integer "group_id"
246 247
    t.index ["group_id"], name: "index_boards_on_group_id", using: :btree
    t.index ["project_id"], name: "index_boards_on_project_id", using: :btree
248 249
  end

Valery Sizov's avatar
Valery Sizov committed
250
  create_table "broadcast_messages", force: :cascade do |t|
251
    t.text "message", null: false
252 253 254 255
    t.datetime "starts_at", null: false
    t.datetime "ends_at", null: false
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
256 257
    t.string "color"
    t.string "font"
258
    t.text "message_html", null: false
259
    t.integer "cached_markdown_version"
260
    t.index ["starts_at", "ends_at", "id"], name: "index_broadcast_messages_on_starts_at_and_ends_at_and_id", using: :btree
261
  end
262

263 264 265
  create_table "chat_names", force: :cascade do |t|
    t.integer "user_id", null: false
    t.integer "service_id", null: false
266
    t.string "team_id", null: false
267
    t.string "team_domain"
268
    t.string "chat_id", null: false
269
    t.string "chat_name"
270
    t.datetime "last_used_at"
271 272
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
273 274
    t.index ["service_id", "team_id", "chat_id"], name: "index_chat_names_on_service_id_and_team_id_and_chat_id", unique: true, using: :btree
    t.index ["user_id", "service_id"], name: "index_chat_names_on_user_id_and_service_id", unique: true, using: :btree
275
  end
276

277
  create_table "chat_teams", force: :cascade do |t|
278
    t.integer "namespace_id", null: false
279 280 281 282
    t.string "team_id"
    t.string "name"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
283
    t.index ["namespace_id"], name: "index_chat_teams_on_namespace_id", unique: true, using: :btree
284 285
  end

286 287 288 289 290
  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"
291
    t.index ["build_id", "chunk_index"], name: "index_ci_build_trace_chunks_on_build_id_and_chunk_index", unique: true, using: :btree
292 293
  end

294 295 296
  create_table "ci_build_trace_section_names", force: :cascade do |t|
    t.integer "project_id", null: false
    t.string "name", null: false
297
    t.index ["project_id", "name"], name: "index_ci_build_trace_section_names_on_project_id_and_name", unique: true, using: :btree
298 299 300
  end

  create_table "ci_build_trace_sections", force: :cascade do |t|
301
    t.integer "project_id", null: false
302 303
    t.datetime_with_timezone "date_start", null: false
    t.datetime_with_timezone "date_end", null: false
304 305
    t.bigint "byte_start", null: false
    t.bigint "byte_end", null: false
306 307
    t.integer "build_id", null: false
    t.integer "section_name_id", null: false
308 309 310
    t.index ["build_id", "section_name_id"], name: "index_ci_build_trace_sections_on_build_id_and_section_name_id", unique: true, using: :btree
    t.index ["project_id"], name: "index_ci_build_trace_sections_on_project_id", using: :btree
    t.index ["section_name_id"], name: "index_ci_build_trace_sections_on_section_name_id", using: :btree
311 312
  end

Valery Sizov's avatar
Valery Sizov committed
313
  create_table "ci_builds", force: :cascade do |t|
314
    t.string "status"
315
    t.datetime "finished_at"
316
    t.text "trace"
317 318 319
    t.datetime "created_at"
    t.datetime "updated_at"
    t.datetime "started_at"
320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336
    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"
337
    t.integer "project_id"
338 339
    t.text "artifacts_metadata"
    t.integer "erased_by_id"
340
    t.datetime "erased_at"
341
    t.datetime "artifacts_expire_at"
342
    t.string "environment"
343
    t.bigint "artifacts_size"
344 345
    t.string "when"
    t.text "yaml_variables"
346
    t.datetime "queued_at"
347
    t.string "token"
Kamil Trzcinski's avatar
Kamil Trzcinski committed
348
    t.integer "lock_version"
349
    t.string "coverage_regex"
350
    t.integer "auto_canceled_by_id"
351
    t.boolean "retried"
352
    t.integer "stage_id"
353 354
    t.integer "artifacts_file_store"
    t.integer "artifacts_metadata_store"
355
    t.boolean "protected"
356
    t.integer "failure_reason"
357
    t.datetime_with_timezone "scheduled_at"
358
    t.string "token_encrypted"
359 360
    t.index ["artifacts_expire_at"], name: "index_ci_builds_on_artifacts_expire_at", where: "(artifacts_file <> ''::text)", using: :btree
    t.index ["auto_canceled_by_id"], name: "index_ci_builds_on_auto_canceled_by_id", using: :btree
361
    t.index ["commit_id", "artifacts_expire_at", "id"], name: "index_ci_builds_on_commit_id_and_artifacts_expireatandidpartial", where: "(((type)::text = 'Ci::Build'::text) AND ((retried = false) OR (retried IS NULL)) AND ((name)::text = ANY (ARRAY[('sast'::character varying)::text, ('dependency_scanning'::character varying)::text, ('sast:container'::character varying)::text, ('container_scanning'::character varying)::text, ('dast'::character varying)::text])))", using: :btree
362 363 364 365 366
    t.index ["commit_id", "stage_idx", "created_at"], name: "index_ci_builds_on_commit_id_and_stage_idx_and_created_at", using: :btree
    t.index ["commit_id", "status", "type"], name: "index_ci_builds_on_commit_id_and_status_and_type", using: :btree
    t.index ["commit_id", "type", "name", "ref"], name: "index_ci_builds_on_commit_id_and_type_and_name_and_ref", using: :btree
    t.index ["commit_id", "type", "ref"], name: "index_ci_builds_on_commit_id_and_type_and_ref", using: :btree
    t.index ["project_id", "id"], name: "index_ci_builds_on_project_id_and_id", using: :btree
367
    t.index ["project_id", "status"], name: "index_ci_builds_project_id_and_status_for_live_jobs_partial2", where: "(((type)::text = 'Ci::Build'::text) AND ((status)::text = ANY (ARRAY[('running'::character varying)::text, ('pending'::character varying)::text, ('created'::character varying)::text])))", using: :btree
368 369 370 371 372 373 374
    t.index ["protected"], name: "index_ci_builds_on_protected", using: :btree
    t.index ["runner_id"], name: "index_ci_builds_on_runner_id", using: :btree
    t.index ["scheduled_at"], name: "partial_index_ci_builds_on_scheduled_at_with_scheduled_jobs", where: "((scheduled_at IS NOT NULL) AND ((type)::text = 'Ci::Build'::text) AND ((status)::text = 'scheduled'::text))", using: :btree
    t.index ["stage_id", "stage_idx"], name: "tmp_build_stage_position_index", where: "(stage_idx IS NOT NULL)", using: :btree
    t.index ["stage_id"], name: "index_ci_builds_on_stage_id", using: :btree
    t.index ["status", "type", "runner_id"], name: "index_ci_builds_on_status_and_type_and_runner_id", using: :btree
    t.index ["token"], name: "index_ci_builds_on_token", unique: true, using: :btree
375
    t.index ["token_encrypted"], name: "index_ci_builds_on_token_encrypted", unique: true, where: "(token_encrypted IS NOT NULL)", using: :btree
376 377
    t.index ["updated_at"], name: "index_ci_builds_on_updated_at", using: :btree
    t.index ["user_id"], name: "index_ci_builds_on_user_id", using: :btree
378 379
  end

380 381
  create_table "ci_builds_metadata", force: :cascade do |t|
    t.integer "build_id", null: false
382
    t.integer "project_id", null: false
383
    t.integer "timeout"
384
    t.integer "timeout_source", default: 1, null: false
385 386
    t.jsonb "config_options"
    t.jsonb "config_variables"
387 388
    t.index ["build_id"], name: "index_ci_builds_metadata_on_build_id", unique: true, using: :btree
    t.index ["project_id"], name: "index_ci_builds_metadata_on_project_id", using: :btree
389 390
  end

391 392 393 394 395
  create_table "ci_builds_runner_session", id: :bigserial, force: :cascade do |t|
    t.integer "build_id", null: false
    t.string "url", null: false
    t.string "certificate"
    t.string "authorization"
396
    t.index ["build_id"], name: "index_ci_builds_runner_session_on_build_id", unique: true, using: :btree
397 398
  end

Shinya Maeda's avatar
Shinya Maeda committed
399
  create_table "ci_group_variables", force: :cascade do |t|
400 401 402 403 404
    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
Shinya Maeda committed
405 406
    t.integer "group_id", null: false
    t.boolean "protected", default: false, null: false
407 408
    t.datetime_with_timezone "created_at", null: false
    t.datetime_with_timezone "updated_at", null: false
409
    t.boolean "masked", default: false, null: false
410
    t.index ["group_id", "key"], name: "index_ci_group_variables_on_group_id_and_key", unique: true, using: :btree
411 412
  end

413 414
  create_table "ci_job_artifacts", force: :cascade do |t|
    t.integer "project_id", null: false
415
    t.integer "job_id", null: false
416
    t.integer "file_type", null: false
417
    t.integer "file_store"
418
    t.bigint "size"
419 420
    t.datetime_with_timezone "created_at", null: false
    t.datetime_with_timezone "updated_at", null: false
421
    t.datetime_with_timezone "expire_at"
422
    t.string "file"
423
    t.binary "file_sha256"
424
    t.integer "file_format", limit: 2
425
    t.integer "file_location", limit: 2
426 427 428 429
    t.index ["expire_at", "job_id"], name: "index_ci_job_artifacts_on_expire_at_and_job_id", using: :btree
    t.index ["file_store"], name: "index_ci_job_artifacts_on_file_store", using: :btree
    t.index ["job_id", "file_type"], name: "index_ci_job_artifacts_on_job_id_and_file_type", unique: true, using: :btree
    t.index ["project_id"], name: "index_ci_job_artifacts_on_project_id", using: :btree
430 431
  end

432 433 434 435 436 437 438 439
  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
    t.index ["chat_name_id"], name: "index_ci_pipeline_chat_data_on_chat_name_id", using: :btree
    t.index ["pipeline_id"], name: "index_ci_pipeline_chat_data_on_pipeline_id", unique: true, using: :btree
  end

Shinya Maeda's avatar
Shinya Maeda committed
440
  create_table "ci_pipeline_schedule_variables", force: :cascade do |t|
Shinya Maeda's avatar
Shinya Maeda committed
441 442 443 444 445
    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
Shinya Maeda committed
446
    t.integer "pipeline_schedule_id", null: false
447 448
    t.datetime_with_timezone "created_at"
    t.datetime_with_timezone "updated_at"
449
    t.index ["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
450 451
  end

452 453 454 455 456 457 458 459 460
  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
461 462
    t.datetime "created_at"
    t.datetime "updated_at"
463
    t.index ["next_run_at", "active"], name: "index_ci_pipeline_schedules_on_next_run_at_and_active", using: :btree
464
    t.index ["owner_id"], name: "index_ci_pipeline_schedules_on_owner_id", using: :btree
465
    t.index ["project_id"], name: "index_ci_pipeline_schedules_on_project_id", using: :btree
466 467
  end

Shinya Maeda's avatar
Shinya Maeda committed
468 469 470 471 472 473 474
  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
475
    t.index ["pipeline_id", "key"], name: "index_ci_pipeline_variables_on_pipeline_id_and_key", unique: true, using: :btree
Shinya Maeda's avatar
Shinya Maeda committed
476 477
  end

478
  create_table "ci_pipelines", force: :cascade do |t|
479 480 481
    t.string "ref"
    t.string "sha"
    t.string "before_sha"
482 483
    t.datetime "created_at"
    t.datetime "updated_at"
484 485
    t.boolean "tag", default: false
    t.text "yaml_errors"
486
    t.datetime "committed_at"
487
    t.integer "project_id"
488
    t.string "status"
489 490
    t.datetime "started_at"
    t.datetime "finished_at"
491 492
    t.integer "duration"
    t.integer "user_id"
Kamil Trzcinski's avatar
Kamil Trzcinski committed
493
    t.integer "lock_version"
494
    t.integer "auto_canceled_by_id"
495
    t.integer "pipeline_schedule_id"
496
    t.integer "source"
497
    t.integer "config_source"
498
    t.boolean "protected"
499
    t.integer "failure_reason"
Shinya Maeda's avatar
Shinya Maeda committed
500
    t.integer "iid"
Shinya Maeda's avatar
Shinya Maeda committed
501
    t.integer "merge_request_id"
502 503
    t.binary "source_sha"
    t.binary "target_sha"
504
    t.index ["auto_canceled_by_id"], name: "index_ci_pipelines_on_auto_canceled_by_id", using: :btree
Shinya Maeda's avatar
Shinya Maeda committed
505
    t.index ["merge_request_id"], name: "index_ci_pipelines_on_merge_request_id", where: "(merge_request_id IS NOT NULL)", using: :btree
506 507
    t.index ["pipeline_schedule_id"], name: "index_ci_pipelines_on_pipeline_schedule_id", using: :btree
    t.index ["project_id", "iid"], name: "index_ci_pipelines_on_project_id_and_iid", unique: true, where: "(iid IS NOT NULL)", using: :btree
508
    t.index ["project_id", "ref", "id"], name: "index_ci_pipelines_on_project_idandrefandiddesc", order: { id: :desc }, using: :btree
509 510 511 512 513 514 515
    t.index ["project_id", "ref", "status", "id"], name: "index_ci_pipelines_on_project_id_and_ref_and_status_and_id", using: :btree
    t.index ["project_id", "sha"], name: "index_ci_pipelines_on_project_id_and_sha", using: :btree
    t.index ["project_id", "source"], name: "index_ci_pipelines_on_project_id_and_source", using: :btree
    t.index ["project_id", "status", "config_source"], name: "index_ci_pipelines_on_project_id_and_status_and_config_source", using: :btree
    t.index ["project_id"], name: "index_ci_pipelines_on_project_id", using: :btree
    t.index ["status"], name: "index_ci_pipelines_on_status", using: :btree
    t.index ["user_id"], name: "index_ci_pipelines_on_user_id", using: :btree
516 517
  end

518
  create_table "ci_runner_namespaces", force: :cascade do |t|
519
    t.integer "runner_id"
520
    t.integer "namespace_id"
521 522
    t.index ["namespace_id"], name: "index_ci_runner_namespaces_on_namespace_id", using: :btree
    t.index ["runner_id", "namespace_id"], name: "index_ci_runner_namespaces_on_runner_id_and_namespace_id", unique: true, using: :btree
523 524
  end

Valery Sizov's avatar
Valery Sizov committed
525
  create_table "ci_runner_projects", force: :cascade do |t|
526
    t.integer "runner_id", null: false
527 528
    t.datetime "created_at"
    t.datetime "updated_at"
529
    t.integer "project_id"
530 531
    t.index ["project_id"], name: "index_ci_runner_projects_on_project_id", using: :btree
    t.index ["runner_id"], name: "index_ci_runner_projects_on_runner_id", using: :btree
532 533
  end

Valery Sizov's avatar
Valery Sizov committed
534
  create_table "ci_runners", force: :cascade do |t|
535
    t.string "token"
536 537
    t.datetime "created_at"
    t.datetime "updated_at"
538
    t.string "description"
539
    t.datetime "contacted_at"
540 541 542 543 544 545 546 547 548
    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
549
    t.integer "access_level", default: 0, null: false
550
    t.string "ip_address"
551
    t.integer "maximum_timeout"
552
    t.integer "runner_type", limit: 2, null: false
553
    t.string "token_encrypted"
554 555 556 557 558
    t.index ["contacted_at"], name: "index_ci_runners_on_contacted_at", using: :btree
    t.index ["is_shared"], name: "index_ci_runners_on_is_shared", using: :btree
    t.index ["locked"], name: "index_ci_runners_on_locked", using: :btree
    t.index ["runner_type"], name: "index_ci_runners_on_runner_type", using: :btree
    t.index ["token"], name: "index_ci_runners_on_token", using: :btree
559
    t.index ["token_encrypted"], name: "index_ci_runners_on_token_encrypted", using: :btree
560 561
  end

562 563 564
  create_table "ci_stages", force: :cascade do |t|
    t.integer "project_id"
    t.integer "pipeline_id"
565 566
    t.datetime "created_at"
    t.datetime "updated_at"
567
    t.string "name"
568
    t.integer "status"
569
    t.integer "lock_version"
570
    t.integer "position"
571 572 573 574
    t.index ["pipeline_id", "name"], name: "index_ci_stages_on_pipeline_id_and_name", unique: true, using: :btree
    t.index ["pipeline_id", "position"], name: "index_ci_stages_on_pipeline_id_and_position", using: :btree
    t.index ["pipeline_id"], name: "index_ci_stages_on_pipeline_id", using: :btree
    t.index ["project_id"], name: "index_ci_stages_on_project_id", using: :btree
575 576
  end

Valery Sizov's avatar
Valery Sizov committed
577
  create_table "ci_trigger_requests", force: :cascade do |t|
578 579
    t.integer "trigger_id", null: false
    t.text "variables"
580 581
    t.datetime "created_at"
    t.datetime "updated_at"
582
    t.integer "commit_id"
583
    t.index ["commit_id"], name: "index_ci_trigger_requests_on_commit_id", using: :btree
584
    t.index ["trigger_id"], name: "index_ci_trigger_requests_on_trigger_id", using: :btree
585 586
  end

Valery Sizov's avatar
Valery Sizov committed
587
  create_table "ci_triggers", force: :cascade do |t|
588
    t.string "token"
589 590
    t.datetime "created_at"
    t.datetime "updated_at"
591
    t.integer "project_id"
Kamil Trzcinski's avatar
Kamil Trzcinski committed
592 593
    t.integer "owner_id"
    t.string "description"
Shinya Maeda's avatar
Shinya Maeda committed
594
    t.string "ref"
595
    t.index ["owner_id"], name: "index_ci_triggers_on_owner_id", using: :btree
596
    t.index ["project_id"], name: "index_ci_triggers_on_project_id", using: :btree
597 598
  end

Valery Sizov's avatar
Valery Sizov committed
599
  create_table "ci_variables", force: :cascade do |t|
600
    t.string "key", null: false
601 602 603 604
    t.text "value"
    t.text "encrypted_value"
    t.string "encrypted_value_salt"
    t.string "encrypted_value_iv"
605
    t.integer "project_id", null: false
606
    t.boolean "protected", default: false, null: false
607
    t.string "environment_scope", default: "*", null: false
608
    t.boolean "masked", default: false, null: false
609
    t.index ["project_id", "key", "environment_scope"], name: "index_ci_variables_on_project_id_and_key_and_environment_scope", unique: true, using: :btree
610 611
  end

612 613 614
  create_table "cluster_groups", force: :cascade do |t|
    t.integer "cluster_id", null: false
    t.integer "group_id", null: false
615 616
    t.index ["cluster_id", "group_id"], name: "index_cluster_groups_on_cluster_id_and_group_id", unique: true, using: :btree
    t.index ["group_id"], name: "index_cluster_groups_on_group_id", using: :btree
617 618
  end

Shinya Maeda's avatar
Shinya Maeda committed
619 620
  create_table "cluster_platforms_kubernetes", force: :cascade do |t|
    t.integer "cluster_id", null: false
Kamil Trzcinski's avatar
Kamil Trzcinski committed
621 622 623
    t.datetime_with_timezone "created_at", null: false
    t.datetime_with_timezone "updated_at", null: false
    t.text "api_url"
Shinya Maeda's avatar
Shinya Maeda committed
624 625 626 627 628 629 630
    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"
631
    t.integer "authorization_type", limit: 2
632
    t.index ["cluster_id"], name: "index_cluster_platforms_kubernetes_on_cluster_id", unique: true, using: :btree
Shinya Maeda's avatar
Shinya Maeda committed
633 634 635 636 637
  end

  create_table "cluster_projects", force: :cascade do |t|
    t.integer "project_id", null: false
    t.integer "cluster_id", null: false
638 639
    t.datetime_with_timezone "created_at", null: false
    t.datetime_with_timezone "updated_at", null: false
640 641
    t.index ["cluster_id"], name: "index_cluster_projects_on_cluster_id", using: :btree
    t.index ["project_id"], name: "index_cluster_projects_on_project_id", using: :btree
Shinya Maeda's avatar
Shinya Maeda committed
642 643 644 645 646
  end

  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
647 648 649
    t.integer "num_nodes", null: false
    t.datetime_with_timezone "created_at", null: false
    t.datetime_with_timezone "updated_at", null: false
Shinya Maeda's avatar
Shinya Maeda committed
650 651 652 653 654 655 656 657
    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"
658
    t.boolean "legacy_abac", default: false, null: false
659
    t.index ["cluster_id"], name: "index_cluster_providers_gcp_on_cluster_id", unique: true, using: :btree
Shinya Maeda's avatar
Shinya Maeda committed
660 661 662
  end

  create_table "clusters", force: :cascade do |t|
663
    t.integer "user_id"
Kamil Trzcinski's avatar
Kamil Trzcinski committed
664 665 666 667
    t.integer "provider_type"
    t.integer "platform_type"
    t.datetime_with_timezone "created_at", null: false
    t.datetime_with_timezone "updated_at", null: false
668 669
    t.boolean "enabled", default: true
    t.string "name", null: false
670
    t.string "environment_scope", default: "*", null: false
671
    t.integer "cluster_type", limit: 2, default: 3, null: false
672
    t.string "domain"
673 674
    t.index ["enabled"], name: "index_clusters_on_enabled", using: :btree
    t.index ["user_id"], name: "index_clusters_on_user_id", using: :btree
675 676
  end

677 678 679 680 681 682 683 684
  create_table "clusters_applications_cert_managers", force: :cascade do |t|
    t.integer "cluster_id", null: false
    t.integer "status", null: false
    t.string "version", null: false
    t.string "email", null: false
    t.datetime_with_timezone "created_at", null: false
    t.datetime_with_timezone "updated_at", null: false
    t.text "status_reason"
685
    t.index ["cluster_id"], name: "index_clusters_applications_cert_managers_on_cluster_id", unique: true, using: :btree
686 687
  end

688 689 690 691 692 693 694
  create_table "clusters_applications_helm", force: :cascade do |t|
    t.integer "cluster_id", null: false
    t.datetime_with_timezone "created_at", null: false
    t.datetime_with_timezone "updated_at", null: false
    t.integer "status", null: false
    t.string "version", null: false
    t.text "status_reason"
695 696 697
    t.text "encrypted_ca_key"
    t.text "encrypted_ca_key_iv"
    t.text "ca_cert"
698
    t.index ["cluster_id"], name: "index_clusters_applications_helm_on_cluster_id", unique: true, using: :btree
699
  end
700

701 702 703 704 705 706 707 708 709
  create_table "clusters_applications_ingress", force: :cascade do |t|
    t.integer "cluster_id", null: false
    t.datetime_with_timezone "created_at", null: false
    t.datetime_with_timezone "updated_at", null: false
    t.integer "status", null: false
    t.integer "ingress_type", null: false
    t.string "version", null: false
    t.string "cluster_ip"
    t.text "status_reason"
710
    t.string "external_ip"
711
    t.index ["cluster_id"], name: "index_clusters_applications_ingress_on_cluster_id", unique: true, using: :btree
712 713
  end

714
  create_table "clusters_applications_jupyter", force: :cascade do |t|
715
    t.integer "cluster_id", null: false
716
    t.integer "oauth_application_id"
717 718 719 720 721
    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
722
    t.text "status_reason"
723 724
    t.index ["cluster_id"], name: "index_clusters_applications_jupyter_on_cluster_id", unique: true, using: :btree
    t.index ["oauth_application_id"], name: "index_clusters_applications_jupyter_on_oauth_application_id", using: :btree
725 726
  end

Chris Baumbauer's avatar
Chris Baumbauer committed
727 728 729 730 731 732
  create_table "clusters_applications_knative", force: :cascade do |t|
    t.integer "cluster_id", null: false
    t.datetime_with_timezone "created_at", null: false
    t.datetime_with_timezone "updated_at", null: false
    t.integer "status", null: false
    t.string "version", null: false
733
    t.string "hostname"
Chris Baumbauer's avatar
Chris Baumbauer committed
734
    t.text "status_reason"
735
    t.string "external_ip"
736
    t.index ["cluster_id"], name: "index_clusters_applications_knative_on_cluster_id", unique: true, using: :btree
Chris Baumbauer's avatar
Chris Baumbauer committed
737 738
  end

739 740 741 742 743 744 745
  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
746
    t.index ["cluster_id"], name: "index_clusters_applications_prometheus_on_cluster_id", unique: true, using: :btree
747 748
  end

749 750 751 752 753 754 755 756
  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"
757
    t.boolean "privileged", default: true, null: false
758 759
    t.index ["cluster_id"], name: "index_clusters_applications_runners_on_cluster_id", unique: true, using: :btree
    t.index ["runner_id"], name: "index_clusters_applications_runners_on_runner_id", using: :btree
760 761
  end

762 763 764 765 766 767 768 769 770 771
  create_table "clusters_kubernetes_namespaces", id: :bigserial, force: :cascade do |t|
    t.integer "cluster_id", null: false
    t.integer "project_id"
    t.integer "cluster_project_id"
    t.datetime_with_timezone "created_at", null: false
    t.datetime_with_timezone "updated_at", null: false
    t.text "encrypted_service_account_token"
    t.string "encrypted_service_account_token_iv"
    t.string "namespace", null: false
    t.string "service_account_name"
772 773 774 775
    t.index ["cluster_id", "namespace"], name: "kubernetes_namespaces_cluster_and_namespace", unique: true, using: :btree
    t.index ["cluster_id"], name: "index_clusters_kubernetes_namespaces_on_cluster_id", using: :btree
    t.index ["cluster_project_id"], name: "index_clusters_kubernetes_namespaces_on_cluster_project_id", using: :btree
    t.index ["project_id"], name: "index_clusters_kubernetes_namespaces_on_project_id", using: :btree
776 777
  end

778
  create_table "container_repositories", force: :cascade do |t|
779 780 781 782
    t.integer "project_id", null: false
    t.string "name", null: false
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
783 784
    t.index ["project_id", "name"], name: "index_container_repositories_on_project_id_and_name", unique: true, using: :btree
    t.index ["project_id"], name: "index_container_repositories_on_project_id", using: :btree
785 786
  end

787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809
  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
810 811 812 813 814 815 816 817 818 819
    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
820
  end
821

Valery Sizov's avatar
Valery Sizov committed
822
  create_table "deploy_keys_projects", force: :cascade do |t|
823 824
    t.integer "deploy_key_id", null: false
    t.integer "project_id", null: false
825 826
    t.datetime "created_at"
    t.datetime "updated_at"
827
    t.boolean "can_push", default: false, null: false
828
    t.index ["project_id"], name: "index_deploy_keys_projects_on_project_id", using: :btree
829
  end
830

831 832
  create_table "deploy_tokens", force: :cascade do |t|
    t.boolean "revoked", default: false
833 834
    t.boolean "read_repository", default: false, null: false
    t.boolean "read_registry", default: false, null: false
835
    t.datetime_with_timezone "expires_at", null: false
836
    t.datetime_with_timezone "created_at", null: false
837 838
    t.string "name", null: false
    t.string "token", null: false
839 840
    t.index ["token", "expires_at", "id"], name: "index_deploy_tokens_on_token_and_expires_at_and_id", where: "(revoked IS FALSE)", using: :btree
    t.index ["token"], name: "index_deploy_tokens_on_token", unique: true, using: :btree
841 842
  end

843
  create_table "deployments", force: :cascade do |t|
Valery Sizov's avatar
Valery Sizov committed
844 845 846 847 848 849
    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
850
    t.integer "user_id"
Valery Sizov's avatar
Valery Sizov committed
851 852
    t.integer "deployable_id"
    t.string "deployable_type"
853 854
    t.datetime "created_at"
    t.datetime "updated_at"
855
    t.string "on_stop"
856
    t.integer "status", limit: 2, null: false
Amit Rathi's avatar
Amit Rathi committed
857
    t.datetime_with_timezone "finished_at"
858 859 860 861 862 863 864 865 866
    t.index ["created_at"], name: "index_deployments_on_created_at", using: :btree
    t.index ["deployable_type", "deployable_id"], name: "index_deployments_on_deployable_type_and_deployable_id", using: :btree
    t.index ["environment_id", "id"], name: "index_deployments_on_environment_id_and_id", using: :btree
    t.index ["environment_id", "iid", "project_id"], name: "index_deployments_on_environment_id_and_iid_and_project_id", using: :btree
    t.index ["environment_id", "status"], name: "index_deployments_on_environment_id_and_status", using: :btree
    t.index ["id"], name: "partial_index_deployments_for_legacy_successful_deployments", where: "((finished_at IS NULL) AND (status = 2))", using: :btree
    t.index ["project_id", "iid"], name: "index_deployments_on_project_id_and_iid", unique: true, using: :btree
    t.index ["project_id", "status", "created_at"], name: "index_deployments_on_project_id_and_status_and_created_at", using: :btree
    t.index ["project_id", "status"], name: "index_deployments_on_project_id_and_status", using: :btree
867 868
  end

Valery Sizov's avatar
Valery Sizov committed
869
  create_table "emails", force: :cascade do |t|
870 871
    t.integer "user_id", null: false
    t.string "email", null: false
872 873
    t.datetime "created_at"
    t.datetime "updated_at"
874
    t.string "confirmation_token"
875 876
    t.datetime_with_timezone "confirmed_at"
    t.datetime_with_timezone "confirmation_sent_at"
877 878 879
    t.index ["confirmation_token"], name: "index_emails_on_confirmation_token", unique: true, using: :btree
    t.index ["email"], name: "index_emails_on_email", unique: true, using: :btree
    t.index ["user_id"], name: "index_emails_on_user_id", using: :btree
880 881
  end

882
  create_table "environments", force: :cascade do |t|
883
    t.integer "project_id", null: false
884
    t.string "name", null: false
885 886
    t.datetime "created_at"
    t.datetime "updated_at"
887 888
    t.string "external_url"
    t.string "environment_type"
889
    t.string "state", default: "available", null: false
Nick Thomas's avatar
Nick Thomas committed
890
    t.string "slug", null: false
891 892
    t.index ["project_id", "name"], name: "index_environments_on_project_id_and_name", unique: true, using: :btree
    t.index ["project_id", "slug"], name: "index_environments_on_project_id_and_slug", unique: true, using: :btree
893 894
  end

Valery Sizov's avatar
Valery Sizov committed
895
  create_table "events", force: :cascade do |t|
896 897 898
    t.integer "project_id"
    t.integer "author_id", null: false
    t.integer "target_id"
899 900
    t.datetime_with_timezone "created_at", null: false
    t.datetime_with_timezone "updated_at", null: false
901 902
    t.integer "action", limit: 2, null: false
    t.string "target_type"
903 904
    t.index ["action"], name: "index_events_on_action", using: :btree
    t.index ["author_id", "project_id"], name: "index_events_on_author_id_and_project_id", using: :btree
905
    t.index ["project_id", "created_at"], name: "index_events_on_project_id_and_created_at", using: :btree
906 907
    t.index ["project_id", "id"], name: "index_events_on_project_id_and_id", using: :btree
    t.index ["target_type", "target_id"], name: "index_events_on_target_type_and_target_id", using: :btree
908 909
  end

910 911 912 913 914 915
  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
916
    t.index ["feature_key", "key", "value"], name: "index_feature_gates_on_feature_key_and_key_and_value", unique: true, using: :btree
917 918 919 920 921 922
  end

  create_table "features", force: :cascade do |t|
    t.string "key", null: false
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
923
    t.index ["key"], name: "index_features_on_key", unique: true, using: :btree
924 925
  end

926 927 928 929
  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"
930
    t.index ["fork_network_id"], name: "index_fork_network_members_on_fork_network_id", using: :btree
931
    t.index ["forked_from_project_id"], name: "index_fork_network_members_on_forked_from_project_id", using: :btree
932
    t.index ["project_id"], name: "index_fork_network_members_on_project_id", unique: true, using: :btree
933 934
  end

935 936 937
  create_table "fork_networks", force: :cascade do |t|
    t.integer "root_project_id"
    t.string "deleted_root_project_name"
938
    t.index ["root_project_id"], name: "index_fork_networks_on_root_project_id", unique: true, using: :btree
939 940
  end

Valery Sizov's avatar
Valery Sizov committed
941
  create_table "forked_project_links", force: :cascade do |t|
942 943
    t.integer "forked_to_project_id", null: false
    t.integer "forked_from_project_id", null: false
944 945
    t.datetime "created_at"
    t.datetime "updated_at"
946
    t.index ["forked_to_project_id"], name: "index_forked_project_links_on_forked_to_project_id", unique: true, using: :btree
947 948
  end

949
  create_table "gpg_key_subkeys", force: :cascade do |t|
950
    t.integer "gpg_key_id", null: false
951 952
    t.binary "keyid"
    t.binary "fingerprint"
953 954 955
    t.index ["fingerprint"], name: "index_gpg_key_subkeys_on_fingerprint", unique: true, using: :btree
    t.index ["gpg_key_id"], name: "index_gpg_key_subkeys_on_gpg_key_id", using: :btree
    t.index ["keyid"], name: "index_gpg_key_subkeys_on_keyid", unique: true, using: :btree
956 957
  end

Alexis Reigel's avatar
Alexis Reigel committed
958
  create_table "gpg_keys", force: :cascade do |t|
959 960
    t.datetime_with_timezone "created_at", null: false
    t.datetime_with_timezone "updated_at", null: false
961
    t.integer "user_id"
962 963
    t.binary "primary_keyid"
    t.binary "fingerprint"
964
    t.text "key"
965 966 967
    t.index ["fingerprint"], name: "index_gpg_keys_on_fingerprint", unique: true, using: :btree
    t.index ["primary_keyid"], name: "index_gpg_keys_on_primary_keyid", unique: true, using: :btree
    t.index ["user_id"], name: "index_gpg_keys_on_user_id", using: :btree
Alexis Reigel's avatar
Alexis Reigel committed
968 969
  end

970
  create_table "gpg_signatures", force: :cascade do |t|
971 972
    t.datetime_with_timezone "created_at", null: false
    t.datetime_with_timezone "updated_at", null: false
973 974
    t.integer "project_id"
    t.integer "gpg_key_id"
975 976
    t.binary "commit_sha"
    t.binary "gpg_key_primary_keyid"
977 978
    t.text "gpg_key_user_name"
    t.text "gpg_key_user_email"
979
    t.integer "verification_status", limit: 2, default: 0, null: false
980
    t.integer "gpg_key_subkey_id"
981 982 983 984 985
    t.index ["commit_sha"], name: "index_gpg_signatures_on_commit_sha", unique: true, using: :btree
    t.index ["gpg_key_id"], name: "index_gpg_signatures_on_gpg_key_id", using: :btree
    t.index ["gpg_key_primary_keyid"], name: "index_gpg_signatures_on_gpg_key_primary_keyid", using: :btree
    t.index ["gpg_key_subkey_id"], name: "index_gpg_signatures_on_gpg_key_subkey_id", using: :btree
    t.index ["project_id"], name: "index_gpg_signatures_on_project_id", using: :btree
986 987
  end

988
  create_table "group_custom_attributes", force: :cascade do |t|
989 990
    t.datetime_with_timezone "created_at", null: false
    t.datetime_with_timezone "updated_at", null: false
991 992 993
    t.integer "group_id", null: false
    t.string "key", null: false
    t.string "value", null: false
994 995
    t.index ["group_id", "key"], name: "index_group_custom_attributes_on_group_id_and_key", unique: true, using: :btree
    t.index ["key", "value"], name: "index_group_custom_attributes_on_key_and_value", using: :btree
996 997
  end

Valery Sizov's avatar
Valery Sizov committed
998
  create_table "identities", force: :cascade do |t|
999 1000 1001
    t.string "extern_uid"
    t.string "provider"
    t.integer "user_id"
1002 1003
    t.datetime "created_at"
    t.datetime "updated_at"
1004
    t.index ["user_id"], name: "index_identities_on_user_id", using: :btree
1005 1006
  end

1007 1008 1009 1010 1011
  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"
1012 1013
    t.index ["project_id"], name: "index_import_export_uploads_on_project_id", using: :btree
    t.index ["updated_at"], name: "index_import_export_uploads_on_updated_at", using: :btree
1014 1015
  end

1016
  create_table "internal_ids", id: :bigserial, force: :cascade do |t|
1017
    t.integer "project_id"
1018 1019
    t.integer "usage", null: false
    t.integer "last_value", null: false
1020
    t.integer "namespace_id"
1021 1022
    t.index ["namespace_id"], name: "index_internal_ids_on_namespace_id", using: :btree
    t.index ["project_id"], name: "index_internal_ids_on_project_id", using: :btree
1023 1024
    t.index ["usage", "namespace_id"], name: "index_internal_ids_on_usage_and_namespace_id", unique: true, where: "(namespace_id IS NOT NULL)", using: :btree
    t.index ["usage", "project_id"], name: "index_internal_ids_on_usage_and_project_id", unique: true, where: "(project_id IS NOT NULL)", using: :btree
1025 1026
  end

1027
  create_table "issue_assignees", id: false, force: :cascade do |t|
1028 1029
    t.integer "user_id", null: false
    t.integer "issue_id", null: false
1030 1031
    t.index ["issue_id", "user_id"], name: "index_issue_assignees_on_issue_id_and_user_id", unique: true, using: :btree
    t.index ["user_id"], name: "index_issue_assignees_on_user_id", using: :btree
1032 1033
  end

1034
  create_table "issue_metrics", force: :cascade do |t|
1035
    t.integer "issue_id", null: false
1036
    t.datetime "first_mentioned_in_commit_at"
1037 1038
    t.datetime "first_associated_with_milestone_at"
    t.datetime "first_added_to_board_at"
1039 1040
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
1041
    t.index ["issue_id"], name: "index_issue_metrics", using: :btree
1042 1043
  end

Valery Sizov's avatar
Valery Sizov committed
1044
  create_table "issues", force: :cascade do |t|
1045 1046 1047
    t.string "title"
    t.integer "author_id"
    t.integer "project_id"
1048 1049
    t.datetime "created_at"
    t.datetime "updated_at"
1050 1051 1052 1053 1054
    t.text "description"
    t.integer "milestone_id"
    t.string "state"
    t.integer "iid"
    t.integer "updated_by_id"
1055
    t.boolean "confidential", default: false, null: false
1056 1057 1058 1059 1060
    t.date "due_date"
    t.integer "moved_to_id"
    t.integer "lock_version"
    t.text "title_html"
    t.text "description_html"
1061
    t.integer "time_estimate"
1062
    t.integer "relative_position"
1063
    t.integer "cached_markdown_version"
1064 1065
    t.datetime "last_edited_at"
    t.integer "last_edited_by_id"
1066
    t.boolean "discussion_locked"
1067
    t.datetime_with_timezone "closed_at"
haseeb's avatar
haseeb committed
1068
    t.integer "closed_by_id"
1069
    t.index ["author_id"], name: "index_issues_on_author_id", using: :btree
1070
    t.index ["closed_by_id"], name: "index_issues_on_closed_by_id", using: :btree
1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083
    t.index ["confidential"], name: "index_issues_on_confidential", using: :btree
    t.index ["description"], name: "index_issues_on_description_trigram", using: :gin, opclasses: {"description"=>"gin_trgm_ops"}
    t.index ["milestone_id"], name: "index_issues_on_milestone_id", using: :btree
    t.index ["moved_to_id"], name: "index_issues_on_moved_to_id", where: "(moved_to_id IS NOT NULL)", using: :btree
    t.index ["project_id", "created_at", "id", "state"], name: "index_issues_on_project_id_and_created_at_and_id_and_state", using: :btree
    t.index ["project_id", "due_date", "id", "state"], name: "idx_issues_on_project_id_and_due_date_and_id_and_state_partial", where: "(due_date IS NOT NULL)", using: :btree
    t.index ["project_id", "iid"], name: "index_issues_on_project_id_and_iid", unique: true, using: :btree
    t.index ["project_id", "updated_at", "id", "state"], name: "index_issues_on_project_id_and_updated_at_and_id_and_state", using: :btree
    t.index ["relative_position"], name: "index_issues_on_relative_position", using: :btree
    t.index ["state"], name: "index_issues_on_state", using: :btree
    t.index ["title"], name: "index_issues_on_title_trigram", using: :gin, opclasses: {"title"=>"gin_trgm_ops"}
    t.index ["updated_at"], name: "index_issues_on_updated_at", using: :btree
    t.index ["updated_by_id"], name: "index_issues_on_updated_by_id", where: "(updated_by_id IS NOT NULL)", using: :btree
Andrew8xx8's avatar
Andrew8xx8 committed
1084 1085
  end

Valery Sizov's avatar
Valery Sizov committed
1086
  create_table "keys", force: :cascade do |t|
1087
    t.integer "user_id"
1088 1089
    t.datetime "created_at"
    t.datetime "updated_at"
1090 1091 1092 1093 1094
    t.text "key"
    t.string "title"
    t.string "type"
    t.string "fingerprint"
    t.boolean "public", default: false, null: false
1095
    t.datetime "last_used_at"
1096 1097
    t.index ["fingerprint"], name: "index_keys_on_fingerprint", unique: tru