schema.rb 120 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: 20181203002526) 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
    t.string "favicon"
41 42
  end

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

Valery Sizov's avatar
Valery Sizov committed
173
  create_table "audit_events", force: :cascade do |t|
174 175 176 177 178
    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"
179 180
    t.datetime "created_at"
    t.datetime "updated_at"
181
    t.index ["entity_id", "entity_type"], name: "index_audit_events_on_entity_id_and_entity_type", using: :btree
182 183
  end

184
  create_table "award_emoji", force: :cascade do |t|
185 186 187 188
    t.string "name"
    t.integer "user_id"
    t.integer "awardable_id"
    t.string "awardable_type"
189 190
    t.datetime "created_at"
    t.datetime "updated_at"
191 192
    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
193 194
  end

195 196 197 198 199 200 201 202
  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
203 204
    t.index ["group_id"], name: "index_badges_on_group_id", using: :btree
    t.index ["project_id"], name: "index_badges_on_project_id", using: :btree
205 206
  end

207 208 209 210 211 212
  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"
213 214 215 216
    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
217 218 219 220 221 222 223 224
  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"
225 226 227 228
    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
229 230
  end

231
  create_table "boards", force: :cascade do |t|
232
    t.integer "project_id"
233 234
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
235
    t.integer "group_id"
236 237
    t.index ["group_id"], name: "index_boards_on_group_id", using: :btree
    t.index ["project_id"], name: "index_boards_on_project_id", using: :btree
238 239
  end

Valery Sizov's avatar
Valery Sizov committed
240
  create_table "broadcast_messages", force: :cascade do |t|
241
    t.text "message", null: false
242 243 244 245
    t.datetime "starts_at", null: false
    t.datetime "ends_at", null: false
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
246 247
    t.string "color"
    t.string "font"
248
    t.text "message_html", null: false
249
    t.integer "cached_markdown_version"
250
    t.index ["starts_at", "ends_at", "id"], name: "index_broadcast_messages_on_starts_at_and_ends_at_and_id", using: :btree
251
  end
252

253 254 255
  create_table "chat_names", force: :cascade do |t|
    t.integer "user_id", null: false
    t.integer "service_id", null: false
256
    t.string "team_id", null: false
257
    t.string "team_domain"
258
    t.string "chat_id", null: false
259
    t.string "chat_name"
260
    t.datetime "last_used_at"
261 262
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
263 264
    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
265
  end
266

267
  create_table "chat_teams", force: :cascade do |t|
268
    t.integer "namespace_id", null: false
269 270 271 272
    t.string "team_id"
    t.string "name"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
273
    t.index ["namespace_id"], name: "index_chat_teams_on_namespace_id", unique: true, using: :btree
274 275
  end

276 277 278 279 280
  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"
281
    t.index ["build_id", "chunk_index"], name: "index_ci_build_trace_chunks_on_build_id_and_chunk_index", unique: true, using: :btree
282 283
  end

284 285 286
  create_table "ci_build_trace_section_names", force: :cascade do |t|
    t.integer "project_id", null: false
    t.string "name", null: false
287
    t.index ["project_id", "name"], name: "index_ci_build_trace_section_names_on_project_id_and_name", unique: true, using: :btree
288 289 290
  end

  create_table "ci_build_trace_sections", force: :cascade do |t|
291
    t.integer "project_id", null: false
292 293
    t.datetime_with_timezone "date_start", null: false
    t.datetime_with_timezone "date_end", null: false
294 295
    t.bigint "byte_start", null: false
    t.bigint "byte_end", null: false
296 297
    t.integer "build_id", null: false
    t.integer "section_name_id", null: false
298 299 300
    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
301 302
  end

Valery Sizov's avatar
Valery Sizov committed
303
  create_table "ci_builds", force: :cascade do |t|
304
    t.string "status"
305
    t.datetime "finished_at"
306
    t.text "trace"
307 308 309
    t.datetime "created_at"
    t.datetime "updated_at"
    t.datetime "started_at"
310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326
    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"
327
    t.integer "project_id"
328 329
    t.text "artifacts_metadata"
    t.integer "erased_by_id"
330
    t.datetime "erased_at"
331
    t.datetime "artifacts_expire_at"
332
    t.string "environment"
333
    t.bigint "artifacts_size"
334 335
    t.string "when"
    t.text "yaml_variables"
336
    t.datetime "queued_at"
337
    t.string "token"
Kamil Trzcinski's avatar
Kamil Trzcinski committed
338
    t.integer "lock_version"
339
    t.string "coverage_regex"
340
    t.integer "auto_canceled_by_id"
341
    t.boolean "retried"
342
    t.integer "stage_id"
343 344
    t.integer "artifacts_file_store"
    t.integer "artifacts_metadata_store"
345
    t.boolean "protected"
346
    t.integer "failure_reason"
347
    t.datetime_with_timezone "scheduled_at"
348
    t.string "token_encrypted"
349 350 351 352 353 354 355 356
    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
    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 ["id"], name: "partial_index_ci_builds_on_id_with_legacy_artifacts", where: "(artifacts_file <> ''::text)", using: :btree
    t.index ["project_id", "id"], name: "index_ci_builds_on_project_id_and_id", using: :btree
357
    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
358 359 360 361 362 363 364
    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
365
    t.index ["token_encrypted"], name: "index_ci_builds_on_token_encrypted", unique: true, where: "(token_encrypted IS NOT NULL)", using: :btree
366 367
    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
368 369
  end

370 371
  create_table "ci_builds_metadata", force: :cascade do |t|
    t.integer "build_id", null: false
372
    t.integer "project_id", null: false
373
    t.integer "timeout"
374
    t.integer "timeout_source", default: 1, null: false
375 376
    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
377 378
  end

379 380 381 382 383
  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"
384
    t.index ["build_id"], name: "index_ci_builds_runner_session_on_build_id", unique: true, using: :btree
385 386
  end

Shinya Maeda's avatar
Shinya Maeda committed
387
  create_table "ci_group_variables", force: :cascade do |t|
388 389 390 391 392
    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
393 394
    t.integer "group_id", null: false
    t.boolean "protected", default: false, null: false
395 396
    t.datetime_with_timezone "created_at", null: false
    t.datetime_with_timezone "updated_at", null: false
397
    t.index ["group_id", "key"], name: "index_ci_group_variables_on_group_id_and_key", unique: true, using: :btree
398 399
  end

400 401
  create_table "ci_job_artifacts", force: :cascade do |t|
    t.integer "project_id", null: false
402
    t.integer "job_id", null: false
403
    t.integer "file_type", null: false
404
    t.integer "file_store"
405
    t.bigint "size"
406 407
    t.datetime_with_timezone "created_at", null: false
    t.datetime_with_timezone "updated_at", null: false
408
    t.datetime_with_timezone "expire_at"
409
    t.string "file"
410
    t.binary "file_sha256"
411
    t.integer "file_format", limit: 2
412
    t.integer "file_location", limit: 2
413 414 415 416
    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
417 418
  end

Shinya Maeda's avatar
Shinya Maeda committed
419
  create_table "ci_pipeline_schedule_variables", force: :cascade do |t|
Shinya Maeda's avatar
Shinya Maeda committed
420 421 422 423 424
    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
425
    t.integer "pipeline_schedule_id", null: false
426 427
    t.datetime_with_timezone "created_at"
    t.datetime_with_timezone "updated_at"
428
    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
429 430
  end

431 432 433 434 435 436 437 438 439
  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
440 441
    t.datetime "created_at"
    t.datetime "updated_at"
442
    t.index ["next_run_at", "active"], name: "index_ci_pipeline_schedules_on_next_run_at_and_active", using: :btree
443
    t.index ["owner_id"], name: "index_ci_pipeline_schedules_on_owner_id", using: :btree
444
    t.index ["project_id"], name: "index_ci_pipeline_schedules_on_project_id", using: :btree
445 446
  end

Shinya Maeda's avatar
Shinya Maeda committed
447 448 449 450 451 452 453
  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
454
    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
455 456
  end

457
  create_table "ci_pipelines", force: :cascade do |t|
458 459 460
    t.string "ref"
    t.string "sha"
    t.string "before_sha"
461 462
    t.datetime "created_at"
    t.datetime "updated_at"
463 464
    t.boolean "tag", default: false
    t.text "yaml_errors"
465
    t.datetime "committed_at"
466
    t.integer "project_id"
467
    t.string "status"
468 469
    t.datetime "started_at"
    t.datetime "finished_at"
470 471
    t.integer "duration"
    t.integer "user_id"
Kamil Trzcinski's avatar
Kamil Trzcinski committed
472
    t.integer "lock_version"
473
    t.integer "auto_canceled_by_id"
474
    t.integer "pipeline_schedule_id"
475
    t.integer "source"
476
    t.integer "config_source"
477
    t.boolean "protected"
478
    t.integer "failure_reason"
Shinya Maeda's avatar
Shinya Maeda committed
479
    t.integer "iid"
Shinya Maeda's avatar
Shinya Maeda committed
480
    t.integer "merge_request_id"
481
    t.index ["auto_canceled_by_id"], name: "index_ci_pipelines_on_auto_canceled_by_id", using: :btree
Shinya Maeda's avatar
Shinya Maeda committed
482
    t.index ["merge_request_id"], name: "index_ci_pipelines_on_merge_request_id", where: "(merge_request_id IS NOT NULL)", using: :btree
483 484 485 486 487 488 489 490 491
    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
    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
492 493
  end

494
  create_table "ci_runner_namespaces", force: :cascade do |t|
495
    t.integer "runner_id"
496
    t.integer "namespace_id"
497 498
    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
499 500
  end

Valery Sizov's avatar
Valery Sizov committed
501
  create_table "ci_runner_projects", force: :cascade do |t|
502
    t.integer "runner_id", null: false
503 504
    t.datetime "created_at"
    t.datetime "updated_at"
505
    t.integer "project_id"
506 507
    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
508 509
  end

Valery Sizov's avatar
Valery Sizov committed
510
  create_table "ci_runners", force: :cascade do |t|
511
    t.string "token"
512 513
    t.datetime "created_at"
    t.datetime "updated_at"
514
    t.string "description"
515
    t.datetime "contacted_at"
516 517 518 519 520 521 522 523 524
    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
525
    t.integer "access_level", default: 0, null: false
526
    t.string "ip_address"
527
    t.integer "maximum_timeout"
528
    t.integer "runner_type", limit: 2, null: false
529
    t.string "token_encrypted"
530 531 532 533 534
    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
535 536
  end

537 538 539
  create_table "ci_stages", force: :cascade do |t|
    t.integer "project_id"
    t.integer "pipeline_id"
540 541
    t.datetime "created_at"
    t.datetime "updated_at"
542
    t.string "name"
543
    t.integer "status"
544
    t.integer "lock_version"
545
    t.integer "position"
546 547 548 549
    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
550 551
  end

Valery Sizov's avatar
Valery Sizov committed
552
  create_table "ci_trigger_requests", force: :cascade do |t|
553 554
    t.integer "trigger_id", null: false
    t.text "variables"
555 556
    t.datetime "created_at"
    t.datetime "updated_at"
557
    t.integer "commit_id"
558
    t.index ["commit_id"], name: "index_ci_trigger_requests_on_commit_id", using: :btree
559
    t.index ["trigger_id"], name: "index_ci_trigger_requests_on_trigger_id", using: :btree
560 561
  end

Valery Sizov's avatar
Valery Sizov committed
562
  create_table "ci_triggers", force: :cascade do |t|
563
    t.string "token"
564 565
    t.datetime "created_at"
    t.datetime "updated_at"
566
    t.integer "project_id"
Kamil Trzcinski's avatar
Kamil Trzcinski committed
567 568
    t.integer "owner_id"
    t.string "description"
Shinya Maeda's avatar
Shinya Maeda committed
569
    t.string "ref"
570
    t.index ["owner_id"], name: "index_ci_triggers_on_owner_id", using: :btree
571
    t.index ["project_id"], name: "index_ci_triggers_on_project_id", using: :btree
572 573
  end

Valery Sizov's avatar
Valery Sizov committed
574
  create_table "ci_variables", force: :cascade do |t|
575
    t.string "key", null: false
576 577 578 579
    t.text "value"
    t.text "encrypted_value"
    t.string "encrypted_value_salt"
    t.string "encrypted_value_iv"
580
    t.integer "project_id", null: false
581
    t.boolean "protected", default: false, null: false
582
    t.string "environment_scope", default: "*", null: false
583
    t.index ["project_id", "key", "environment_scope"], name: "index_ci_variables_on_project_id_and_key_and_environment_scope", unique: true, using: :btree
584 585
  end

586 587 588
  create_table "cluster_groups", force: :cascade do |t|
    t.integer "cluster_id", null: false
    t.integer "group_id", null: false
589 590
    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
591 592
  end

Shinya Maeda's avatar
Shinya Maeda committed
593 594
  create_table "cluster_platforms_kubernetes", force: :cascade do |t|
    t.integer "cluster_id", null: false
Kamil Trzcinski's avatar
Kamil Trzcinski committed
595 596 597
    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
598 599 600 601 602 603 604
    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"
605
    t.integer "authorization_type", limit: 2
606
    t.index ["cluster_id"], name: "index_cluster_platforms_kubernetes_on_cluster_id", unique: true, using: :btree
Shinya Maeda's avatar
Shinya Maeda committed
607 608 609 610 611
  end

  create_table "cluster_projects", force: :cascade do |t|
    t.integer "project_id", null: false
    t.integer "cluster_id", null: false
612 613
    t.datetime_with_timezone "created_at", null: false
    t.datetime_with_timezone "updated_at", null: false
614 615
    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
616 617 618 619 620
  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
621 622 623
    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
624 625 626 627 628 629 630 631
    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"
632
    t.boolean "legacy_abac", default: true, null: false
633
    t.index ["cluster_id"], name: "index_cluster_providers_gcp_on_cluster_id", unique: true, using: :btree
Shinya Maeda's avatar
Shinya Maeda committed
634 635 636
  end

  create_table "clusters", force: :cascade do |t|
637
    t.integer "user_id"
Kamil Trzcinski's avatar
Kamil Trzcinski committed
638 639 640 641
    t.integer "provider_type"
    t.integer "platform_type"
    t.datetime_with_timezone "created_at", null: false
    t.datetime_with_timezone "updated_at", null: false
642 643
    t.boolean "enabled", default: true
    t.string "name", null: false
644
    t.string "environment_scope", default: "*", null: false
645
    t.integer "cluster_type", limit: 2, default: 3, null: false
646 647
    t.index ["enabled"], name: "index_clusters_on_enabled", using: :btree
    t.index ["user_id"], name: "index_clusters_on_user_id", using: :btree
Shinya Maeda's avatar
Shinya Maeda committed
648 649
  end

650 651 652 653 654 655 656 657
  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"
658
    t.index ["cluster_id"], name: "index_clusters_applications_cert_managers_on_cluster_id", unique: true, using: :btree
659 660
  end

661 662 663 664 665 666 667
  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"
668 669 670
    t.text "encrypted_ca_key"
    t.text "encrypted_ca_key_iv"
    t.text "ca_cert"
671
    t.index ["cluster_id"], name: "index_clusters_applications_helm_on_cluster_id", unique: true, using: :btree
672
  end
673

674 675 676 677 678 679 680 681 682
  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"
683
    t.string "external_ip"
684
    t.index ["cluster_id"], name: "index_clusters_applications_ingress_on_cluster_id", unique: true, using: :btree
685 686
  end

687
  create_table "clusters_applications_jupyter", force: :cascade do |t|
688
    t.integer "cluster_id", null: false
689
    t.integer "oauth_application_id"
690 691 692 693 694
    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
695
    t.text "status_reason"
696 697
    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
698 699
  end

Chris Baumbauer's avatar
Chris Baumbauer committed
700 701 702 703 704 705
  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
706
    t.string "hostname"
Chris Baumbauer's avatar
Chris Baumbauer committed
707
    t.text "status_reason"
708
    t.string "external_ip"
709
    t.index ["cluster_id"], name: "index_clusters_applications_knative_on_cluster_id", unique: true, using: :btree
Chris Baumbauer's avatar
Chris Baumbauer committed
710 711
  end

712 713 714 715 716 717 718
  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
719
    t.index ["cluster_id"], name: "index_clusters_applications_prometheus_on_cluster_id", unique: true, using: :btree
720 721
  end

722 723 724 725 726 727 728 729
  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"
730
    t.boolean "privileged", default: true, null: false
731 732
    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
733 734
  end

735 736 737 738 739 740 741 742 743 744
  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"
745 746 747 748
    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
749 750
  end

751
  create_table "container_repositories", force: :cascade do |t|
752 753 754 755
    t.integer "project_id", null: false
    t.string "name", null: false
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
756 757
    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
758 759
  end

760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782
  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
783 784 785 786 787 788 789 790 791 792
    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
793
  end
794

Valery Sizov's avatar
Valery Sizov committed
795
  create_table "deploy_keys_projects", force: :cascade do |t|
796 797
    t.integer "deploy_key_id", null: false
    t.integer "project_id", null: false
798 799
    t.datetime "created_at"
    t.datetime "updated_at"
800
    t.boolean "can_push", default: false, null: false
801
    t.index ["project_id"], name: "index_deploy_keys_projects_on_project_id", using: :btree
802
  end
803

804 805
  create_table "deploy_tokens", force: :cascade do |t|
    t.boolean "revoked", default: false
806 807
    t.boolean "read_repository", default: false, null: false
    t.boolean "read_registry", default: false, null: false
808
    t.datetime_with_timezone "expires_at", null: false
809
    t.datetime_with_timezone "created_at", null: false
810 811
    t.string "name", null: false
    t.string "token", null: false
812 813
    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
814 815
  end

816
  create_table "deployments", force: :cascade do |t|
Valery Sizov's avatar
Valery Sizov committed
817 818 819 820 821 822
    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
823
    t.integer "user_id"
Valery Sizov's avatar
Valery Sizov committed
824 825
    t.integer "deployable_id"
    t.string "deployable_type"
826 827
    t.datetime "created_at"
    t.datetime "updated_at"
828
    t.string "on_stop"
829
    t.integer "status", limit: 2, null: false
830
    t.datetime_with_timezone "finished_at"
831 832 833 834 835 836 837 838 839
    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
840 841
  end

Valery Sizov's avatar
Valery Sizov committed
842
  create_table "emails", force: :cascade do |t|
843 844
    t.integer "user_id", null: false
    t.string "email", null: false
845 846
    t.datetime "created_at"
    t.datetime "updated_at"
847
    t.string "confirmation_token"
848 849
    t.datetime_with_timezone "confirmed_at"
    t.datetime_with_timezone "confirmation_sent_at"
850 851 852
    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
853 854
  end

855
  create_table "environments", force: :cascade do |t|
856
    t.integer "project_id", null: false
857
    t.string "name", null: false
858 859
    t.datetime "created_at"
    t.datetime "updated_at"
860 861
    t.string "external_url"
    t.string "environment_type"
862
    t.string "state", default: "available", null: false
Nick Thomas's avatar
Nick Thomas committed
863
    t.string "slug", null: false
864 865
    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
866 867
  end

Valery Sizov's avatar
Valery Sizov committed
868
  create_table "events", force: :cascade do |t|
869 870 871
    t.integer "project_id"
    t.integer "author_id", null: false
    t.integer "target_id"
872 873
    t.datetime_with_timezone "created_at", null: false
    t.datetime_with_timezone "updated_at", null: false
874 875
    t.integer "action", limit: 2, null: false
    t.string "target_type"
876 877
    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
878
    t.index ["project_id", "created_at"], name: "index_events_on_project_id_and_created_at", using: :btree
879 880
    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
881 882
  end

883 884 885 886 887 888
  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
889
    t.index ["feature_key", "key", "value"], name: "index_feature_gates_on_feature_key_and_key_and_value", unique: true, using: :btree
890 891 892 893 894 895
  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
896
    t.index ["key"], name: "index_features_on_key", unique: true, using: :btree
897 898
  end

899 900 901 902
  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"
903
    t.index ["fork_network_id"], name: "index_fork_network_members_on_fork_network_id", using: :btree
904
    t.index ["forked_from_project_id"], name: "index_fork_network_members_on_forked_from_project_id", using: :btree
905
    t.index ["project_id"], name: "index_fork_network_members_on_project_id", unique: true, using: :btree
906 907
  end

908 909 910
  create_table "fork_networks", force: :cascade do |t|
    t.integer "root_project_id"
    t.string "deleted_root_project_name"
911
    t.index ["root_project_id"], name: "index_fork_networks_on_root_project_id", unique: true, using: :btree
912 913
  end

Valery Sizov's avatar
Valery Sizov committed
914
  create_table "forked_project_links", force: :cascade do |t|
915 916
    t.integer "forked_to_project_id", null: false
    t.integer "forked_from_project_id", null: false
917 918
    t.datetime "created_at"
    t.datetime "updated_at"
919
    t.index ["forked_to_project_id"], name: "index_forked_project_links_on_forked_to_project_id", unique: true, using: :btree
920 921
  end

922
  create_table "gpg_key_subkeys", force: :cascade do |t|
923
    t.integer "gpg_key_id", null: false
924 925
    t.binary "keyid"
    t.binary "fingerprint"
926 927 928
    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
929 930
  end

Alexis Reigel's avatar
Alexis Reigel committed
931
  create_table "gpg_keys", force: :cascade do |t|
932 933
    t.datetime_with_timezone "created_at", null: false
    t.datetime_with_timezone "updated_at", null: false
934
    t.integer "user_id"
935 936
    t.binary "primary_keyid"
    t.binary "fingerprint"
937
    t.text "key"
938 939 940
    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
941 942
  end

943
  create_table "gpg_signatures", force: :cascade do |t|
944 945
    t.datetime_with_timezone "created_at", null: false
    t.datetime_with_timezone "updated_at", null: false
946 947
    t.integer "project_id"
    t.integer "gpg_key_id"
948 949
    t.binary "commit_sha"
    t.binary "gpg_key_primary_keyid"
950 951
    t.text "gpg_key_user_name"
    t.text "gpg_key_user_email"
952
    t.integer "verification_status", limit: 2, default: 0, null: false
953
    t.integer "gpg_key_subkey_id"
954 955 956 957 958
    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
959 960
  end

961
  create_table "group_custom_attributes", force: :cascade do |t|
962 963
    t.datetime_with_timezone "created_at", null: false
    t.datetime_with_timezone "updated_at", null: false
964 965 966
    t.integer "group_id", null: false
    t.string "key", null: false
    t.string "value", null: false
967 968
    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
969 970
  end

Valery Sizov's avatar
Valery Sizov committed
971
  create_table "identities", force: :cascade do |t|
972 973 974
    t.string "extern_uid"
    t.string "provider"
    t.integer "user_id"
975 976
    t.datetime "created_at"
    t.datetime "updated_at"
977
    t.index ["user_id"], name: "index_identities_on_user_id", using: :btree
978 979
  end

980 981 982 983 984
  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"
985 986
    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
987 988
  end

989
  create_table "internal_ids", id: :bigserial, force: :cascade do |t|
990
    t.integer "project_id"
991 992
    t.integer "usage", null: false
    t.integer "last_value", null: false
993
    t.integer "namespace_id"
994 995
    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
996 997
    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
998 999
  end

1000
  create_table "issue_assignees", id: false, force: :cascade do |t|
1001 1002
    t.integer "user_id", null: false
    t.integer "issue_id", null: false
1003 1004
    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
1005 1006
  end

1007
  create_table "issue_metrics", force: :cascade do |t|
1008
    t.integer "issue_id", null: false
1009
    t.datetime "first_mentioned_in_commit_at"
1010 1011
    t.datetime "first_associated_with_milestone_at"
    t.datetime "first_added_to_board_at"
1012 1013
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
1014
    t.index ["issue_id"], name: "index_issue_metrics", using: :btree
1015 1016
  end

Valery Sizov's avatar
Valery Sizov committed
1017
  create_table "issues", force: :cascade do |t|
1018 1019 1020
    t.string "title"
    t.integer "author_id"
    t.integer "project_id"
1021 1022
    t.datetime "created_at"
    t.datetime "updated_at"
1023 1024 1025 1026 1027
    t.text "description"
    t.integer "milestone_id"
    t.string "state"
    t.integer "iid"
    t.integer "updated_by_id"
1028
    t.boolean "confidential", default: false, null: false
1029 1030 1031 1032 1033
    t.date "due_date"
    t.integer "moved_to_id"
    t.integer "lock_version"
    t.text "title_html"
    t.text "description_html"
1034
    t.integer "time_estimate"
1035
    t.integer "relative_position"
1036
    t.integer "cached_markdown_version"
1037 1038
    t.datetime "last_edited_at"
    t.integer "last_edited_by_id"
1039
    t.boolean "discussion_locked"
1040
    t.datetime_with_timezone "closed_at"
haseeb's avatar
haseeb committed
1041
    t.integer "closed_by_id"
1042
    t.index ["author_id"], name: "index_issues_on_author_id", using: :btree
1043
    t.index ["closed_by_id"], name: "index_issues_on_closed_by_id", using: :btree
1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056
    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
1057 1058
  end

Valery Sizov's avatar
Valery Sizov committed
1059
  create_table "keys", force: :cascade do |t|
1060
    t.integer "user_id"
1061 1062
    t.datetime "created_at"
    t.datetime "updated_at"
1063 1064 1065 1066 1067
    t.text "key"
    t.string "title"
    t.string "type"
    t.string "fingerprint"
    t.boolean "public", default: false, null: false
1068
    t.datetime "last_used_at"
1069 1070
    t.index ["fingerprint"], name: "index_keys_on_fingerprint", unique: true, using: :btree
    t.index ["user_id"], name: "index_keys_on_user_id", using: :btree
Andrew8xx8's avatar
Andrew8xx8 committed
1071 1072
  end

Valery Sizov's avatar
Valery Sizov committed
1073
  create_table "label_links", force: :cascade do |t|
1074 1075 1076
    t.integer "label_id"
    t.integer "target_id"
    t.string "target_type"
1077 1078
    t.datetime "created_at"
    t.datetime "updated_at"
1079 1080
    t.index ["label_id"], name: "index_label_links_on_label_id", using: :btree
    t.index ["target_id", "target_type"], name: "index_label_links_on_target_id_and_target_type", using: :btree
1081 1082
  end

1083 1084 1085 1086 1087 1088
  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
1089
    t.index ["label_id"], name: "index_label_priorities_on_label_id", using: :btree
1090 1091
    t.index ["priority"], name: "index_label_priorities_on_priority", using: :btree
    t.index ["project_id", "label_id"], name: "index_label_priorities_on_project_id_and_label_id", unique: true, using: :btree
1092 1093
  end

Valery Sizov's avatar
Valery Sizov committed
1094
  create_table "labels", force: :cascade do |t|
1095 1096 1097
    t.string "title"
    t.string "color"
    t.integer "project_id"
1098 1099
    t.datetime "created_at"
    t.datetime "updated_at"
1100 1101 1102
    t.boolean "template", default: false
    t.string "description"
    t.text "description_html"
1103 1104
    t.string "type"
    t.integer "group_id"