schema.rb 240 KB
Newer Older
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.
12

13
ActiveRecord::Schema.define(version: 2019_11_18_182722) do
Felipe's avatar
Felipe committed
14

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

Jasper Maes's avatar
Jasper Maes committed
19
  create_table "abuse_reports", id: :serial, 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
    t.index ["user_id"], name: "index_abuse_reports_on_user_id"
28 29
  end

30 31 32 33 34 35 36 37 38
  create_table "alerts_service_data", force: :cascade do |t|
    t.integer "service_id", null: false
    t.datetime_with_timezone "created_at", null: false
    t.datetime_with_timezone "updated_at", null: false
    t.string "encrypted_token", limit: 255
    t.string "encrypted_token_iv", limit: 255
    t.index ["service_id"], name: "index_alerts_service_data_on_service_id"
  end

39 40 41 42 43 44 45 46
  create_table "allowed_email_domains", force: :cascade do |t|
    t.datetime_with_timezone "created_at", null: false
    t.datetime_with_timezone "updated_at", null: false
    t.integer "group_id", null: false
    t.string "domain", limit: 255, null: false
    t.index ["group_id"], name: "index_allowed_email_domains_on_group_id"
  end

47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
  create_table "analytics_cycle_analytics_group_stages", force: :cascade do |t|
    t.datetime_with_timezone "created_at", null: false
    t.datetime_with_timezone "updated_at", null: false
    t.integer "relative_position"
    t.integer "start_event_identifier", null: false
    t.integer "end_event_identifier", null: false
    t.bigint "group_id", null: false
    t.bigint "start_event_label_id"
    t.bigint "end_event_label_id"
    t.boolean "hidden", default: false, null: false
    t.boolean "custom", default: true, null: false
    t.string "name", limit: 255, null: false
    t.index ["end_event_label_id"], name: "index_analytics_ca_group_stages_on_end_event_label_id"
    t.index ["group_id", "name"], name: "index_analytics_ca_group_stages_on_group_id_and_name", unique: true
    t.index ["group_id"], name: "index_analytics_ca_group_stages_on_group_id"
    t.index ["relative_position"], name: "index_analytics_ca_group_stages_on_relative_position"
    t.index ["start_event_label_id"], name: "index_analytics_ca_group_stages_on_start_event_label_id"
  end

  create_table "analytics_cycle_analytics_project_stages", force: :cascade do |t|
    t.datetime_with_timezone "created_at", null: false
    t.datetime_with_timezone "updated_at", null: false
    t.integer "relative_position"
    t.integer "start_event_identifier", null: false
    t.integer "end_event_identifier", null: false
    t.bigint "project_id", null: false
    t.bigint "start_event_label_id"
    t.bigint "end_event_label_id"
    t.boolean "hidden", default: false, null: false
    t.boolean "custom", default: true, null: false
    t.string "name", limit: 255, null: false
    t.index ["end_event_label_id"], name: "index_analytics_ca_project_stages_on_end_event_label_id"
    t.index ["project_id", "name"], name: "index_analytics_ca_project_stages_on_project_id_and_name", unique: true
    t.index ["project_id"], name: "index_analytics_ca_project_stages_on_project_id"
    t.index ["relative_position"], name: "index_analytics_ca_project_stages_on_relative_position"
    t.index ["start_event_label_id"], name: "index_analytics_ca_project_stages_on_start_event_label_id"
  end

85 86 87 88 89 90 91 92 93 94 95 96
  create_table "analytics_language_trend_repository_languages", id: false, force: :cascade do |t|
    t.integer "file_count", default: 0, null: false
    t.bigint "programming_language_id", null: false
    t.bigint "project_id", null: false
    t.integer "loc", default: 0, null: false
    t.integer "bytes", default: 0, null: false
    t.integer "percentage", limit: 2, default: 0, null: false
    t.date "snapshot_date", null: false
    t.index ["programming_language_id", "project_id", "snapshot_date"], name: "analytics_repository_languages_unique_index", unique: true
    t.index ["project_id"], name: "analytics_repository_languages_on_project_id"
  end

97
  create_table "analytics_repository_file_commits", force: :cascade do |t|
98
    t.bigint "analytics_repository_file_id", null: false
99
    t.bigint "project_id", null: false
100
    t.date "committed_date", null: false
101 102 103
    t.integer "commit_count", limit: 2, null: false
    t.index ["analytics_repository_file_id"], name: "index_analytics_repository_file_commits_file_id"
    t.index ["project_id", "committed_date", "analytics_repository_file_id"], name: "index_file_commits_on_committed_date_file_id_and_project_id", unique: true
104 105
  end

106 107 108 109 110 111 112 113 114
  create_table "analytics_repository_file_edits", force: :cascade do |t|
    t.bigint "project_id", null: false
    t.bigint "analytics_repository_file_id", null: false
    t.date "committed_date", null: false
    t.integer "num_edits", default: 0, null: false
    t.index ["analytics_repository_file_id", "committed_date", "project_id"], name: "index_file_edits_on_committed_date_file_id_and_project_id", unique: true
    t.index ["project_id"], name: "index_analytics_repository_file_edits_on_project_id"
  end

115 116 117 118 119 120
  create_table "analytics_repository_files", force: :cascade do |t|
    t.bigint "project_id", null: false
    t.string "file_path", limit: 4096, null: false
    t.index ["project_id", "file_path"], name: "index_analytics_repository_files_on_project_id_and_file_path", unique: true
  end

Jasper Maes's avatar
Jasper Maes committed
121
  create_table "appearances", id: :serial, force: :cascade do |t|
122 123
    t.string "title", null: false
    t.text "description", null: false
124 125
    t.string "logo"
    t.integer "updated_by"
126
    t.string "header_logo"
127 128
    t.datetime_with_timezone "created_at", null: false
    t.datetime_with_timezone "updated_at", null: false
129
    t.text "description_html"
130
    t.integer "cached_markdown_version"
131 132
    t.text "new_project_guidelines"
    t.text "new_project_guidelines_html"
133 134 135 136
    t.text "header_message"
    t.text "header_message_html"
    t.text "footer_message"
    t.text "footer_message_html"
137 138
    t.text "message_background_color"
    t.text "message_font_color"
139
    t.string "favicon"
140
    t.boolean "email_header_and_footer_enabled", default: false, null: false
Valeriy's avatar
Valeriy committed
141 142
  end

Jasper Maes's avatar
Jasper Maes committed
143
  create_table "application_setting_terms", id: :serial, force: :cascade do |t|
144 145 146 147 148
    t.integer "cached_markdown_version"
    t.text "terms", null: false
    t.text "terms_html"
  end

Jasper Maes's avatar
Jasper Maes committed
149
  create_table "application_settings", id: :serial, force: :cascade do |t|
150 151 152 153
    t.integer "default_projects_limit"
    t.boolean "signup_enabled"
    t.boolean "gravatar_enabled"
    t.text "sign_in_text"
154 155
    t.datetime "created_at"
    t.datetime "updated_at"
156 157 158 159 160 161
    t.string "home_page_url"
    t.integer "default_branch_protection", default: 2
    t.text "help_text"
    t.text "restricted_visibility_levels"
    t.boolean "version_check_enabled", default: true
    t.integer "max_attachment_size", default: 10, null: false
162 163
    t.integer "default_project_visibility", default: 0, null: false
    t.integer "default_snippet_visibility", default: 0, null: false
164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201
    t.text "domain_whitelist"
    t.boolean "user_oauth_applications", default: true
    t.string "after_sign_out_path"
    t.integer "session_expire_delay", default: 10080, null: false
    t.text "import_sources"
    t.text "help_page_text"
    t.string "admin_notification_email"
    t.boolean "shared_runners_enabled", default: true, null: false
    t.integer "max_artifacts_size", default: 100, null: false
    t.string "runners_registration_token"
    t.integer "max_pages_size", default: 100, null: false
    t.boolean "require_two_factor_authentication", default: false
    t.integer "two_factor_grace_period", default: 48
    t.boolean "metrics_enabled", default: false
    t.string "metrics_host", default: "localhost"
    t.integer "metrics_pool_size", default: 16
    t.integer "metrics_timeout", default: 10
    t.integer "metrics_method_call_threshold", default: 10
    t.boolean "recaptcha_enabled", default: false
    t.string "recaptcha_site_key"
    t.string "recaptcha_private_key"
    t.integer "metrics_port", default: 8089
    t.boolean "akismet_enabled", default: false
    t.string "akismet_api_key"
    t.integer "metrics_sample_interval", default: 15
    t.boolean "email_author_in_body", default: false
    t.integer "default_group_visibility"
    t.boolean "repository_checks_enabled", default: false
    t.text "shared_runners_text"
    t.integer "metrics_packet_size", default: 1
    t.text "disabled_oauth_sign_in_sources"
    t.string "health_check_access_token"
    t.boolean "send_user_confirmation_email", default: false
    t.integer "container_registry_token_expire_delay", default: 5
    t.text "after_sign_up_text"
    t.boolean "user_default_external", default: false, null: false
    t.boolean "elasticsearch_indexing", default: false, null: false
    t.boolean "elasticsearch_search", default: false, null: false
202
    t.string "repository_storages", default: "default"
203 204 205 206 207 208 209 210
    t.string "enabled_git_access_protocol"
    t.boolean "domain_blacklist_enabled", default: false
    t.text "domain_blacklist"
    t.boolean "usage_ping_enabled", default: true, null: false
    t.text "sign_in_text_html"
    t.text "help_page_text_html"
    t.text "shared_runners_text_html"
    t.text "after_sign_up_text_html"
211
    t.integer "rsa_key_restriction", default: 0, null: false
212
    t.integer "dsa_key_restriction", default: -1, null: false
213 214
    t.integer "ecdsa_key_restriction", default: 0, null: false
    t.integer "ed25519_key_restriction", default: 0, null: false
215 216 217 218 219
    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
220
    t.boolean "html_emails_enabled", default: true
221 222
    t.string "plantuml_url"
    t.boolean "plantuml_enabled"
223
    t.integer "shared_runners_minutes", default: 0, null: false
224
    t.bigint "repository_size_limit", default: 0
225
    t.integer "terminal_max_session_time", default: 0, null: false
226 227 228
    t.integer "unique_ips_limit_per_user"
    t.integer "unique_ips_limit_time_window"
    t.boolean "unique_ips_limit_enabled", default: false, null: false
229 230 231 232 233 234
    t.string "default_artifacts_expire_in", default: "0", null: false
    t.string "elasticsearch_url", default: "http://localhost:9200"
    t.boolean "elasticsearch_aws", default: false, null: false
    t.string "elasticsearch_aws_region", default: "us-east-1"
    t.string "elasticsearch_aws_access_key"
    t.string "elasticsearch_aws_secret_access_key"
235
    t.integer "geo_status_timeout", default: 10
236
    t.string "uuid"
237
    t.decimal "polling_interval_multiplier", default: "1.0", null: false
238
    t.boolean "elasticsearch_experimental_indexer"
239
    t.integer "cached_markdown_version"
240
    t.boolean "check_namespace_plan", default: false, null: false
241
    t.integer "mirror_max_delay", default: 300, null: false
242 243
    t.integer "mirror_max_capacity", default: 100, null: false
    t.integer "mirror_capacity_threshold", default: 50, null: false
244
    t.boolean "prometheus_metrics_enabled", default: true, null: false
245
    t.boolean "authorized_keys_enabled", default: true, null: false
246 247
    t.boolean "help_page_hide_commercial_content", default: false
    t.string "help_page_support_url"
Valery Sizov's avatar
Valery Sizov committed
248 249 250 251
    t.boolean "slack_app_enabled", default: false
    t.string "slack_app_id"
    t.string "slack_app_secret"
    t.string "slack_app_verification_token"
252
    t.integer "performance_bar_allowed_group_id"
253
    t.boolean "allow_group_owners_to_manage_ldap", default: true, null: false
254
    t.boolean "hashed_storage_enabled", default: true, null: false
255
    t.boolean "project_export_enabled", default: true, null: false
256
    t.boolean "auto_devops_enabled", default: true, null: false
257 258 259 260 261 262 263 264 265
    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
266 267 268
    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
269
    t.boolean "mirror_available", default: true, null: false
270 271
    t.boolean "password_authentication_enabled_for_web"
    t.boolean "password_authentication_enabled_for_git", default: true, null: false
272
    t.string "auto_devops_domain"
273 274 275
    t.boolean "external_authorization_service_enabled", default: false, null: false
    t.string "external_authorization_service_url"
    t.string "external_authorization_service_default_label"
276
    t.boolean "pages_domain_verification_enabled", default: true, null: false
277
    t.string "user_default_internal_regex"
278
    t.float "external_authorization_service_timeout", default: 0.5
279 280 281 282 283
    t.text "external_auth_client_cert"
    t.text "encrypted_external_auth_client_key"
    t.string "encrypted_external_auth_client_key_iv"
    t.string "encrypted_external_auth_client_key_pass"
    t.string "encrypted_external_auth_client_key_pass_iv"
284
    t.string "email_additional_text"
285
    t.boolean "enforce_terms", default: false
286
    t.integer "file_template_project_id"
287
    t.boolean "pseudonymizer_enabled", default: false, null: false
288
    t.boolean "hide_third_party_offers", default: false, null: false
Imre Farkas's avatar
Imre Farkas committed
289
    t.boolean "snowplow_enabled", default: false, null: false
290
    t.string "snowplow_collector_hostname"
Imre Farkas's avatar
Imre Farkas committed
291
    t.string "snowplow_cookie_domain"
Luke Bennett's avatar
Luke Bennett committed
292
    t.boolean "instance_statistics_visibility_private", default: false, null: false
293
    t.boolean "web_ide_clientside_preview_enabled", default: false, null: false
294
    t.boolean "user_show_add_ssh_key_message", default: true, null: false
Luke Bennett's avatar
Luke Bennett committed
295
    t.integer "custom_project_templates_group_id"
296
    t.integer "usage_stats_set_by_user_id"
297
    t.integer "receive_max_input_size"
298
    t.integer "diff_max_patch_bytes", default: 102400, null: false
299
    t.integer "archive_builds_in_seconds"
300
    t.string "commit_email_hostname"
301
    t.boolean "protected_ci_variables", default: false, null: false
302
    t.string "runners_registration_token_encrypted"
303
    t.integer "local_markdown_version", default: 0, null: false
304
    t.integer "first_day_of_week", default: 0, null: false
305
    t.boolean "elasticsearch_limit_indexing", default: false, null: false
Gosia Ksionek's avatar
Gosia Ksionek committed
306
    t.integer "default_project_creation", default: 2, null: false
307 308
    t.string "lets_encrypt_notification_email"
    t.boolean "lets_encrypt_terms_of_service_accepted", default: false, null: false
309
    t.string "geo_node_allowed_ips", default: "0.0.0.0/0, ::/0"
310 311
    t.integer "elasticsearch_shards", default: 5, null: false
    t.integer "elasticsearch_replicas", default: 1, null: false
312 313
    t.text "encrypted_lets_encrypt_private_key"
    t.text "encrypted_lets_encrypt_private_key_iv"
314
    t.string "required_instance_ci_template"
315
    t.boolean "dns_rebinding_protection_enabled", default: true, null: false
316
    t.boolean "default_project_deletion_protection", default: false, null: false
317
    t.boolean "grafana_enabled", default: false, null: false
318
    t.boolean "lock_memberships_to_ldap", default: false, null: false
319
    t.boolean "time_tracking_limit_to_hours", default: false, null: false
320
    t.string "grafana_url", default: "/-/grafana", null: false
321
    t.boolean "login_recaptcha_protection_enabled", default: false, null: false
322
    t.string "outbound_local_requests_whitelist", limit: 255, default: [], null: false, array: true
323
    t.integer "raw_blob_request_limit", default: 300, null: false
324
    t.boolean "allow_local_requests_from_web_hooks_and_services", default: false, null: false
325
    t.boolean "allow_local_requests_from_system_hooks", default: true, null: false
326
    t.bigint "instance_administration_project_id"
327 328 329 330 331
    t.boolean "asset_proxy_enabled", default: false, null: false
    t.string "asset_proxy_url"
    t.text "asset_proxy_whitelist"
    t.text "encrypted_asset_proxy_secret_key"
    t.string "encrypted_asset_proxy_secret_key_iv"
332 333
    t.string "static_objects_external_storage_url", limit: 255
    t.string "static_objects_external_storage_auth_token", limit: 255
334
    t.boolean "throttle_protected_paths_enabled", default: false, null: false
335 336 337
    t.integer "throttle_protected_paths_requests_per_period", default: 10, null: false
    t.integer "throttle_protected_paths_period_in_seconds", default: 60, null: false
    t.string "protected_paths", limit: 255, default: ["/users/password", "/users/sign_in", "/api/v3/session.json", "/api/v3/session", "/api/v4/session.json", "/api/v4/session", "/users", "/users/confirmation", "/unsubscribes/", "/import/github/personal_access_token"], array: true
338 339 340
    t.boolean "throttle_incident_management_notification_enabled", default: false, null: false
    t.integer "throttle_incident_management_notification_period_in_seconds", default: 3600
    t.integer "throttle_incident_management_notification_per_period", default: 3600
341
    t.string "snowplow_iglu_registry_url", limit: 255
342
    t.integer "push_event_hooks_limit", default: 3, null: false
343
    t.integer "push_event_activities_limit", default: 3, null: false
344
    t.string "custom_http_clone_url_root", limit: 511
345
    t.integer "deletion_adjourned_period", default: 7, null: false
346
    t.date "license_trial_ends_on"
347 348 349 350 351
    t.boolean "eks_integration_enabled", default: false, null: false
    t.string "eks_account_id", limit: 128
    t.string "eks_access_key_id", limit: 128
    t.string "encrypted_eks_secret_access_key_iv", limit: 255
    t.text "encrypted_eks_secret_access_key"
352
    t.string "snowplow_app_id"
353
    t.datetime_with_timezone "productivity_analytics_start_date"
354
    t.string "default_ci_config_path", limit: 255
355 356
    t.boolean "sourcegraph_enabled", default: false, null: false
    t.string "sourcegraph_url", limit: 255
357
    t.boolean "sourcegraph_public_only", default: true, null: false
358 359
    t.index ["custom_project_templates_group_id"], name: "index_application_settings_on_custom_project_templates_group_id"
    t.index ["file_template_project_id"], name: "index_application_settings_on_file_template_project_id"
360
    t.index ["instance_administration_project_id"], name: "index_applicationsettings_on_instance_administration_project_id"
361
    t.index ["usage_stats_set_by_user_id"], name: "index_application_settings_on_usage_stats_set_by_user_id"
Valeriy's avatar
Valeriy committed
362 363
  end

Jasper Maes's avatar
Jasper Maes committed
364
  create_table "approval_merge_request_rule_sources", force: :cascade do |t|
365 366
    t.bigint "approval_merge_request_rule_id", null: false
    t.bigint "approval_project_rule_id", null: false
367 368
    t.index ["approval_merge_request_rule_id"], name: "index_approval_merge_request_rule_sources_1", unique: true
    t.index ["approval_project_rule_id"], name: "index_approval_merge_request_rule_sources_2"
369 370
  end

Jasper Maes's avatar
Jasper Maes committed
371
  create_table "approval_merge_request_rules", force: :cascade do |t|
372 373 374 375 376 377
    t.datetime_with_timezone "created_at", null: false
    t.datetime_with_timezone "updated_at", null: false
    t.integer "merge_request_id", null: false
    t.integer "approvals_required", limit: 2, default: 0, null: false
    t.boolean "code_owner", default: false, null: false
    t.string "name", null: false
378
    t.integer "rule_type", limit: 2, default: 1, null: false
379
    t.integer "report_type", limit: 2
380 381
    t.index ["merge_request_id", "code_owner", "name"], name: "approval_rule_name_index_for_code_owners", unique: true, where: "(code_owner = true)"
    t.index ["merge_request_id", "code_owner"], name: "index_approval_merge_request_rules_1"
382 383 384
    t.index ["merge_request_id", "name"], name: "index_approval_rule_name_for_code_owners_rule_type", unique: true, where: "(rule_type = 2)"
    t.index ["merge_request_id", "rule_type"], name: "any_approver_merge_request_rule_type_unique_index", unique: true, where: "(rule_type = 4)"
    t.index ["merge_request_id"], name: "index_approval_rules_code_owners_rule_type", where: "(rule_type = 2)"
385 386
  end

Jasper Maes's avatar
Jasper Maes committed
387
  create_table "approval_merge_request_rules_approved_approvers", force: :cascade do |t|
388
    t.bigint "approval_merge_request_rule_id", null: false
389
    t.integer "user_id", null: false
390 391
    t.index ["approval_merge_request_rule_id", "user_id"], name: "index_approval_merge_request_rules_approved_approvers_1", unique: true
    t.index ["user_id"], name: "index_approval_merge_request_rules_approved_approvers_2"
392 393
  end

Jasper Maes's avatar
Jasper Maes committed
394
  create_table "approval_merge_request_rules_groups", force: :cascade do |t|
395 396
    t.bigint "approval_merge_request_rule_id", null: false
    t.integer "group_id", null: false
397 398
    t.index ["approval_merge_request_rule_id", "group_id"], name: "index_approval_merge_request_rules_groups_1", unique: true
    t.index ["group_id"], name: "index_approval_merge_request_rules_groups_2"
399 400
  end

Jasper Maes's avatar
Jasper Maes committed
401
  create_table "approval_merge_request_rules_users", force: :cascade do |t|
402 403
    t.bigint "approval_merge_request_rule_id", null: false
    t.integer "user_id", null: false
404 405
    t.index ["approval_merge_request_rule_id", "user_id"], name: "index_approval_merge_request_rules_users_1", unique: true
    t.index ["user_id"], name: "index_approval_merge_request_rules_users_2"
406 407
  end

Jasper Maes's avatar
Jasper Maes committed
408
  create_table "approval_project_rules", force: :cascade do |t|
409 410 411 412 413
    t.datetime_with_timezone "created_at", null: false
    t.datetime_with_timezone "updated_at", null: false
    t.integer "project_id", null: false
    t.integer "approvals_required", limit: 2, default: 0, null: false
    t.string "name", null: false
414
    t.integer "rule_type", limit: 2, default: 0, null: false
415
    t.index ["project_id"], name: "any_approver_project_rule_type_unique_index", unique: true, where: "(rule_type = 3)"
416 417
    t.index ["project_id"], name: "index_approval_project_rules_on_project_id"
    t.index ["rule_type"], name: "index_approval_project_rules_on_rule_type"
418 419
  end

Jasper Maes's avatar
Jasper Maes committed
420
  create_table "approval_project_rules_groups", force: :cascade do |t|
421 422
    t.bigint "approval_project_rule_id", null: false
    t.integer "group_id", null: false
423 424
    t.index ["approval_project_rule_id", "group_id"], name: "index_approval_project_rules_groups_1", unique: true
    t.index ["group_id"], name: "index_approval_project_rules_groups_2"
425 426
  end

Jasper Maes's avatar
Jasper Maes committed
427
  create_table "approval_project_rules_users", force: :cascade do |t|
428 429
    t.bigint "approval_project_rule_id", null: false
    t.integer "user_id", null: false
430 431
    t.index ["approval_project_rule_id", "user_id"], name: "index_approval_project_rules_users_1", unique: true
    t.index ["user_id"], name: "index_approval_project_rules_users_2"
432 433
  end

Jasper Maes's avatar
Jasper Maes committed
434
  create_table "approvals", id: :serial, force: :cascade do |t|
435 436
    t.integer "merge_request_id", null: false
    t.integer "user_id", null: false
Valeriy's avatar
Valeriy committed
437 438
    t.datetime "created_at"
    t.datetime "updated_at"
439 440
    t.index ["merge_request_id"], name: "index_approvals_on_merge_request_id"
    t.index ["user_id", "merge_request_id"], name: "index_approvals_on_user_id_and_merge_request_id", unique: true
441 442
  end

Jasper Maes's avatar
Jasper Maes committed
443
  create_table "approver_groups", id: :serial, force: :cascade do |t|
444 445 446
    t.integer "target_id", null: false
    t.string "target_type", null: false
    t.integer "group_id", null: false
Valery Sizov's avatar
Valery Sizov committed
447 448
    t.datetime "created_at"
    t.datetime "updated_at"
449 450
    t.index ["group_id"], name: "index_approver_groups_on_group_id"
    t.index ["target_id", "target_type"], name: "index_approver_groups_on_target_id_and_target_type"
Valery Sizov's avatar
Valery Sizov committed
451 452
  end

Jasper Maes's avatar
Jasper Maes committed
453
  create_table "approvers", id: :serial, force: :cascade do |t|
454 455 456
    t.integer "target_id", null: false
    t.string "target_type"
    t.integer "user_id", null: false
Valeriy's avatar
Valeriy committed
457 458
    t.datetime "created_at"
    t.datetime "updated_at"
459 460
    t.index ["target_id", "target_type"], name: "index_approvers_on_target_id_and_target_type"
    t.index ["user_id"], name: "index_approvers_on_user_id"
Valeriy's avatar
Valeriy committed
461 462
  end

Jasper Maes's avatar
Jasper Maes committed
463
  create_table "audit_events", id: :serial, force: :cascade do |t|
464 465 466 467 468
    t.integer "author_id", null: false
    t.string "type", null: false
    t.integer "entity_id", null: false
    t.string "entity_type", null: false
    t.text "details"
Marin Jankovski's avatar
Marin Jankovski committed
469 470
    t.datetime "created_at"
    t.datetime "updated_at"
471 472
    t.index ["created_at", "author_id"], name: "analytics_index_audit_events_on_created_at_and_author_id"
    t.index ["entity_id", "entity_type"], name: "index_audit_events_on_entity_id_and_entity_type"
Marin Jankovski's avatar
Marin Jankovski committed
473 474
  end

Jasper Maes's avatar
Jasper Maes committed
475
  create_table "award_emoji", id: :serial, force: :cascade do |t|
476 477 478 479
    t.string "name"
    t.integer "user_id"
    t.integer "awardable_id"
    t.string "awardable_type"
480 481
    t.datetime "created_at"
    t.datetime "updated_at"
482 483
    t.index ["awardable_type", "awardable_id"], name: "index_award_emoji_on_awardable_type_and_awardable_id"
    t.index ["user_id", "name"], name: "index_award_emoji_on_user_id_and_name"
484 485
  end

Tiger Watson's avatar
Tiger Watson committed
486 487 488 489 490 491 492 493 494
  create_table "aws_roles", primary_key: "user_id", id: :integer, default: nil, force: :cascade do |t|
    t.datetime_with_timezone "created_at", null: false
    t.datetime_with_timezone "updated_at", null: false
    t.string "role_arn", limit: 2048, null: false
    t.string "role_external_id", limit: 64, null: false
    t.index ["role_external_id"], name: "index_aws_roles_on_role_external_id", unique: true
    t.index ["user_id"], name: "index_aws_roles_on_user_id", unique: true
  end

Jasper Maes's avatar
Jasper Maes committed
495
  create_table "badges", id: :serial, force: :cascade do |t|
496 497 498 499 500 501 502
    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
503 504
    t.index ["group_id"], name: "index_badges_on_group_id"
    t.index ["project_id"], name: "index_badges_on_project_id"
505 506
  end

Jasper Maes's avatar
Jasper Maes committed
507
  create_table "board_assignees", id: :serial, force: :cascade do |t|
508 509
    t.integer "board_id", null: false
    t.integer "assignee_id", null: false
510 511
    t.index ["assignee_id"], name: "index_board_assignees_on_assignee_id"
    t.index ["board_id", "assignee_id"], name: "index_board_assignees_on_board_id_and_assignee_id", unique: true
512 513
  end

Jasper Maes's avatar
Jasper Maes committed
514
  create_table "board_group_recent_visits", force: :cascade do |t|
515 516 517 518 519
    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"
520 521 522 523
    t.index ["board_id"], name: "index_board_group_recent_visits_on_board_id"
    t.index ["group_id"], name: "index_board_group_recent_visits_on_group_id"
    t.index ["user_id", "group_id", "board_id"], name: "index_board_group_recent_visits_on_user_group_and_board", unique: true
    t.index ["user_id"], name: "index_board_group_recent_visits_on_user_id"
524 525
  end

Jasper Maes's avatar
Jasper Maes committed
526
  create_table "board_labels", id: :serial, force: :cascade do |t|
527
    t.integer "board_id", null: false
Oswaldo Ferreira's avatar
Oswaldo Ferreira committed
528
    t.integer "label_id", null: false
529 530
    t.index ["board_id", "label_id"], name: "index_board_labels_on_board_id_and_label_id", unique: true
    t.index ["label_id"], name: "index_board_labels_on_label_id"
Oswaldo Ferreira's avatar
Oswaldo Ferreira committed
531 532
  end

Jasper Maes's avatar
Jasper Maes committed
533
  create_table "board_project_recent_visits", force: :cascade do |t|
534 535 536 537 538
    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"
539 540 541 542
    t.index ["board_id"], name: "index_board_project_recent_visits_on_board_id"
    t.index ["project_id"], name: "index_board_project_recent_visits_on_project_id"
    t.index ["user_id", "project_id", "board_id"], name: "index_board_project_recent_visits_on_user_project_and_board", unique: true
    t.index ["user_id"], name: "index_board_project_recent_visits_on_user_id"
543 544
  end

Jasper Maes's avatar
Jasper Maes committed
545
  create_table "boards", id: :serial, force: :cascade do |t|
546
    t.integer "project_id"
547 548
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
549
    t.string "name", default: "Development", null: false
550
    t.integer "milestone_id"
Felipe's avatar
Felipe committed
551
    t.integer "group_id"
552
    t.integer "weight"
553 554 555
    t.index ["group_id"], name: "index_boards_on_group_id"
    t.index ["milestone_id"], name: "index_boards_on_milestone_id"
    t.index ["project_id"], name: "index_boards_on_project_id"
556 557
  end

Jasper Maes's avatar
Jasper Maes committed
558
  create_table "broadcast_messages", id: :serial, force: :cascade do |t|
559
    t.text "message", null: false
560 561 562 563
    t.datetime "starts_at", null: false
    t.datetime "ends_at", null: false
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
564 565
    t.string "color"
    t.string "font"
566
    t.text "message_html", null: false
567
    t.integer "cached_markdown_version"
568
    t.index ["starts_at", "ends_at", "id"], name: "index_broadcast_messages_on_starts_at_and_ends_at_and_id"
569
  end
570

Jasper Maes's avatar
Jasper Maes committed
571
  create_table "chat_names", id: :serial, force: :cascade do |t|
572 573
    t.integer "user_id", null: false
    t.integer "service_id", null: false
574
    t.string "team_id", null: false
575
    t.string "team_domain"
576
    t.string "chat_id", null: false
577
    t.string "chat_name"
578
    t.datetime "last_used_at"
579 580
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
581 582
    t.index ["service_id", "team_id", "chat_id"], name: "index_chat_names_on_service_id_and_team_id_and_chat_id", unique: true
    t.index ["user_id", "service_id"], name: "index_chat_names_on_user_id_and_service_id", unique: true
583 584
  end

Jasper Maes's avatar
Jasper Maes committed
585
  create_table "chat_teams", id: :serial, force: :cascade do |t|
586
    t.integer "namespace_id", null: false
587 588 589 590
    t.string "team_id"
    t.string "name"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
591
    t.index ["namespace_id"], name: "index_chat_teams_on_namespace_id", unique: true
592 593
  end

Kamil Trzciński's avatar
Kamil Trzciński committed
594 595 596 597 598 599
  create_table "ci_build_needs", id: :serial, force: :cascade do |t|
    t.integer "build_id", null: false
    t.text "name", null: false
    t.index ["build_id", "name"], name: "index_ci_build_needs_on_build_id_and_name", unique: true
  end

Jasper Maes's avatar
Jasper Maes committed
600
  create_table "ci_build_trace_chunks", force: :cascade do |t|
601 602 603 604
    t.integer "build_id", null: false
    t.integer "chunk_index", null: false
    t.integer "data_store", null: false
    t.binary "raw_data"
605
    t.index ["build_id", "chunk_index"], name: "index_ci_build_trace_chunks_on_build_id_and_chunk_index", unique: true
606 607
  end

Jasper Maes's avatar
Jasper Maes committed
608
  create_table "ci_build_trace_section_names", id: :serial, force: :cascade do |t|
609 610
    t.integer "project_id", null: false
    t.string "name", null: false
611
    t.index ["project_id", "name"], name: "index_ci_build_trace_section_names_on_project_id_and_name", unique: true
612 613
  end

614
  create_table "ci_build_trace_sections", id: false, force: :cascade do |t|
615
    t.integer "project_id", null: false
616 617
    t.datetime "date_start", null: false
    t.datetime "date_end", null: false
618 619
    t.bigint "byte_start", null: false
    t.bigint "byte_end", null: false
620 621
    t.integer "build_id", null: false
    t.integer "section_name_id", null: false
622 623 624
    t.index ["build_id", "section_name_id"], name: "index_ci_build_trace_sections_on_build_id_and_section_name_id", unique: true
    t.index ["project_id"], name: "index_ci_build_trace_sections_on_project_id"
    t.index ["section_name_id"], name: "index_ci_build_trace_sections_on_section_name_id"
625 626
  end

Jasper Maes's avatar
Jasper Maes committed
627
  create_table "ci_builds", id: :serial, force: :cascade do |t|
628
    t.string "status"
629
    t.datetime "finished_at"
630
    t.text "trace"
631 632 633
    t.datetime "created_at"
    t.datetime "updated_at"
    t.datetime "started_at"
634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650
    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"
651
    t.integer "project_id"
652 653
    t.text "artifacts_metadata"
    t.integer "erased_by_id"
654
    t.datetime "erased_at"
655
    t.datetime "artifacts_expire_at"
656
    t.string "environment"
657
    t.bigint "artifacts_size"
658 659
    t.string "when"
    t.text "yaml_variables"
660
    t.datetime "queued_at"
661
    t.string "token"
662
    t.integer "lock_version"
663
    t.string "coverage_regex"
664
    t.integer "auto_canceled_by_id"
665
    t.boolean "retried"
666
    t.integer "stage_id"
667 668
    t.integer "artifacts_file_store"
    t.integer "artifacts_metadata_store"
669
    t.boolean "protected"
670
    t.integer "failure_reason"
Shinya Maeda's avatar
Shinya Maeda committed
671
    t.datetime_with_timezone "scheduled_at"
672
    t.string "token_encrypted"
673
    t.integer "upstream_pipeline_id"
674 675 676 677 678 679 680 681 682 683
    t.index ["artifacts_expire_at"], name: "index_ci_builds_on_artifacts_expire_at", where: "(artifacts_file <> ''::text)"
    t.index ["auto_canceled_by_id"], name: "index_ci_builds_on_auto_canceled_by_id"
    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])))"
    t.index ["commit_id", "stage_idx", "created_at"], name: "index_ci_builds_on_commit_id_and_stage_idx_and_created_at"
    t.index ["commit_id", "status", "type"], name: "index_ci_builds_on_commit_id_and_status_and_type"
    t.index ["commit_id", "type", "name", "ref"], name: "index_ci_builds_on_commit_id_and_type_and_name_and_ref"
    t.index ["commit_id", "type", "ref"], name: "index_ci_builds_on_commit_id_and_type_and_ref"
    t.index ["name"], name: "index_ci_builds_on_name_for_security_products_values", where: "((name)::text = ANY (ARRAY[('container_scanning'::character varying)::text, ('dast'::character varying)::text, ('dependency_scanning'::character varying)::text, ('license_management'::character varying)::text, ('sast'::character varying)::text]))"
    t.index ["project_id", "id"], name: "index_ci_builds_on_project_id_and_id"
    t.index ["project_id", "status"], name: "index_ci_builds_project_id_and_status_for_live_jobs_partial2", where: "(((type)::text = 'Ci::Build'::text) AND ((status)::text = ANY (ARRAY[('running'::character varying)::text, ('pending'::character varying)::text, ('created'::character varying)::text])))"
684
    t.index ["project_id"], name: "index_ci_builds_on_project_id_for_successfull_pages_deploy", where: "(((type)::text = 'GenericCommitStatus'::text) AND ((stage)::text = 'deploy'::text) AND ((name)::text = 'pages:deploy'::text) AND ((status)::text = 'success'::text))"
685 686 687 688 689 690
    t.index ["protected"], name: "index_ci_builds_on_protected"
    t.index ["queued_at"], name: "index_ci_builds_on_queued_at"
    t.index ["runner_id"], name: "index_ci_builds_on_runner_id"
    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))"
    t.index ["stage_id", "stage_idx"], name: "tmp_build_stage_position_index", where: "(stage_idx IS NOT NULL)"
    t.index ["stage_id"], name: "index_ci_builds_on_stage_id"
691
    t.index ["status", "created_at", "project_id"], name: "ci_builds_gitlab_monitor_metrics", where: "((type)::text = 'Ci::Build'::text)"
692 693 694 695 696 697
    t.index ["status", "type", "runner_id"], name: "index_ci_builds_on_status_and_type_and_runner_id"
    t.index ["token"], name: "index_ci_builds_on_token", unique: true
    t.index ["token_encrypted"], name: "index_ci_builds_on_token_encrypted", unique: true, where: "(token_encrypted IS NOT NULL)"
    t.index ["updated_at"], name: "index_ci_builds_on_updated_at"
    t.index ["upstream_pipeline_id"], name: "index_ci_builds_on_upstream_pipeline_id", where: "(upstream_pipeline_id IS NOT NULL)"
    t.index ["user_id"], name: "index_ci_builds_on_user_id"
698 699
  end

Jasper Maes's avatar
Jasper Maes committed
700
  create_table "ci_builds_metadata", id: :serial, force: :cascade do |t|
701 702 703 704
    t.integer "build_id", null: false
    t.integer "project_id", null: false
    t.integer "timeout"
    t.integer "timeout_source", default: 1, null: false
705
    t.boolean "interruptible"
706 707
    t.jsonb "config_options"
    t.jsonb "config_variables"
708
    t.boolean "has_exposed_artifacts"
709
    t.index ["build_id"], name: "index_ci_builds_metadata_on_build_id", unique: true
710
    t.index ["build_id"], name: "index_ci_builds_metadata_on_build_id_and_has_exposed_artifacts", where: "(has_exposed_artifacts IS TRUE)"
711
    t.index ["build_id"], name: "index_ci_builds_metadata_on_build_id_and_interruptible", where: "(interruptible = true)"
712
    t.index ["project_id"], name: "index_ci_builds_metadata_on_project_id"
713 714
  end

Jasper Maes's avatar
Jasper Maes committed
715
  create_table "ci_builds_runner_session", force: :cascade do |t|
716 717 718 719
    t.integer "build_id", null: false
    t.string "url", null: false
    t.string "certificate"
    t.string "authorization"
720
    t.index ["build_id"], name: "index_ci_builds_runner_session_on_build_id", unique: true
721 722
  end

Jasper Maes's avatar
Jasper Maes committed
723
  create_table "ci_group_variables", id: :serial, force: :cascade do |t|
724 725 726 727 728
    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
729 730
    t.integer "group_id", null: false
    t.boolean "protected", default: false, null: false
731 732
    t.datetime_with_timezone "created_at", null: false
    t.datetime_with_timezone "updated_at", null: false
Matija Čupić's avatar
Matija Čupić committed
733
    t.boolean "masked", default: false, null: false
734
    t.integer "variable_type", limit: 2, default: 1, null: false
735
    t.index ["group_id", "key"], name: "index_ci_group_variables_on_group_id_and_key", unique: true
736 737
  end

Jasper Maes's avatar
Jasper Maes committed
738
  create_table "ci_job_artifacts", id: :serial, force: :cascade do |t|
739
    t.integer "project_id", null: false
740
    t.integer "job_id", null: false
741
    t.integer "file_type", null: false
742
    t.bigint "size"
743 744
    t.datetime_with_timezone "created_at", null: false
    t.datetime_with_timezone "updated_at", null: false
745
    t.datetime_with_timezone "expire_at"
746
    t.string "file"
747
    t.integer "file_store"
748
    t.binary "file_sha256"
749
    t.integer "file_format", limit: 2
750
    t.integer "file_location", limit: 2
751 752 753 754
    t.index ["expire_at", "job_id"], name: "index_ci_job_artifacts_on_expire_at_and_job_id"
    t.index ["file_store"], name: "index_ci_job_artifacts_on_file_store"
    t.index ["job_id", "file_type"], name: "index_ci_job_artifacts_on_job_id_and_file_type", unique: true
    t.index ["project_id"], name: "index_ci_job_artifacts_on_project_id"
755
    t.index ["project_id"], name: "index_ci_job_artifacts_on_project_id_for_security_reports", where: "(file_type = ANY (ARRAY[5, 6, 7, 8]))"
756 757
  end

Matija Čupić's avatar
Matija Čupić committed
758 759 760 761 762 763 764 765 766 767
  create_table "ci_job_variables", force: :cascade do |t|
    t.string "key", null: false
    t.text "encrypted_value"
    t.string "encrypted_value_iv"
    t.bigint "job_id", null: false
    t.integer "variable_type", limit: 2, default: 1, null: false
    t.index ["job_id"], name: "index_ci_job_variables_on_job_id"
    t.index ["key", "job_id"], name: "index_ci_job_variables_on_key_and_job_id", unique: true
  end

Jasper Maes's avatar
Jasper Maes committed
768
  create_table "ci_pipeline_chat_data", force: :cascade do |t|
769 770 771
    t.integer "pipeline_id", null: false
    t.integer "chat_name_id", null: false
    t.text "response_url", null: false
772 773
    t.index ["chat_name_id"], name: "index_ci_pipeline_chat_data_on_chat_name_id"
    t.index ["pipeline_id"], name: "index_ci_pipeline_chat_data_on_pipeline_id", unique: true
774 775
  end

Jasper Maes's avatar
Jasper Maes committed
776
  create_table "ci_pipeline_schedule_variables", id: :serial, force: :cascade do |t|
shinya maeda's avatar
shinya maeda committed
777 778 779 780 781
    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
782
    t.integer "pipeline_schedule_id", null: false
783 784
    t.datetime_with_timezone "created_at"
    t.datetime_with_timezone "updated_at"
785
    t.integer "variable_type", limit: 2, default: 1, null: false
786
    t.index ["pipeline_schedule_id", "key"], name: "index_ci_pipeline_schedule_variables_on_schedule_id_and_key", unique: true
shinya maeda's avatar
shinya maeda committed
787 788
  end

Jasper Maes's avatar
Jasper Maes committed
789
  create_table "ci_pipeline_schedules", id: :serial, force: :cascade do |t|
790 791 792 793 794 795 796 797 798 799
    t.string "description"
    t.string "ref"
    t.string "cron"
    t.string "cron_timezone"
    t.datetime "next_run_at"
    t.integer "project_id"
    t.integer "owner_id"
    t.boolean "active", default: true
    t.datetime "created_at"
    t.datetime "updated_at"
800 801 802
    t.index ["next_run_at", "active"], name: "index_ci_pipeline_schedules_on_next_run_at_and_active"
    t.index ["owner_id"], name: "index_ci_pipeline_schedules_on_owner_id"
    t.index ["project_id"], name: "index_ci_pipeline_schedules_on_project_id"
803 804
  end

Jasper Maes's avatar
Jasper Maes committed
805
  create_table "ci_pipeline_variables", id: :serial, force: :cascade do |t|
806 807 808 809 810 811
    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
812
    t.integer "variable_type", limit: 2, default: 1, null: false
813
    t.index ["pipeline_id", "key"], name: "index_ci_pipeline_variables_on_pipeline_id_and_key", unique: true
814 815
  end

Jasper Maes's avatar
Jasper Maes committed
816
  create_table "ci_pipelines", id: :serial, force: :cascade do |t|
817 818 819
    t.string "ref"
    t.string "sha"
    t.string "before_sha"
820 821
    t.datetime "created_at"
    t.datetime "updated_at"
822 823
    t.boolean "tag", default: false
    t.text "yaml_errors"
824
    t.datetime "committed_at"
825
    t.integer "project_id"
826
    t.string "status"
Kamil Trzciński's avatar
Kamil Trzciński committed
827 828
    t.datetime "started_at"
    t.datetime "finished_at"
829 830
    t.integer "duration"
    t.integer "user_id"
831
    t.integer "lock_version"
832
    t.integer "auto_canceled_by_id"
833
    t.integer "pipeline_schedule_id"
834
    t.integer "source"
835
    t.integer "config_source"
836
    t.boolean "protected"
837
    t.integer "failure_reason"
Micaël Bergeron's avatar
Micaël Bergeron committed
838
    t.integer "iid"
Shinya Maeda's avatar
Shinya Maeda committed
839
    t.integer "merge_request_id"
840 841
    t.binary "source_sha"
    t.binary "target_sha"
842
    t.bigint "external_pull_request_id"
843
    t.index ["auto_canceled_by_id"], name: "index_ci_pipelines_on_auto_canceled_by_id"
844
    t.index ["external_pull_request_id"], name: "index_ci_pipelines_on_external_pull_request_id", where: "(external_pull_request_id IS NOT NULL)"
845 846 847 848 849 850 851 852 853 854 855
    t.index ["merge_request_id"], name: "index_ci_pipelines_on_merge_request_id", where: "(merge_request_id IS NOT NULL)"
    t.index ["pipeline_schedule_id"], name: "index_ci_pipelines_on_pipeline_schedule_id"
    t.index ["project_id", "iid"], name: "index_ci_pipelines_on_project_id_and_iid", unique: true, where: "(iid IS NOT NULL)"
    t.index ["project_id", "ref", "id"], name: "index_ci_pipelines_on_project_idandrefandiddesc", order: { id: :desc }
    t.index ["project_id", "ref", "status", "id"], name: "index_ci_pipelines_on_project_id_and_ref_and_status_and_id"
    t.index ["project_id", "sha"], name: "index_ci_pipelines_on_project_id_and_sha"
    t.index ["project_id", "source"], name: "index_ci_pipelines_on_project_id_and_source"
    t.index ["project_id", "status", "config_source"], name: "index_ci_pipelines_on_project_id_and_status_and_config_source"
    t.index ["project_id"], name: "index_ci_pipelines_on_project_id"
    t.index ["status"], name: "index_ci_pipelines_on_status"
    t.index ["user_id"], name: "index_ci_pipelines_on_user_id"
856 857
  end

Jasper Maes's avatar
Jasper Maes committed
858
  create_table "ci_runner_namespaces", id: :serial, force: :cascade do |t|
859
    t.integer "runner_id"
860
    t.integer "namespace_id"
861 862
    t.index ["namespace_id"], name: "index_ci_runner_namespaces_on_namespace_id"
    t.index ["runner_id", "namespace_id"], name: "index_ci_runner_namespaces_on_runner_id_and_namespace_id", unique: true
863 864
  end

Jasper Maes's avatar
Jasper Maes committed
865
  create_table "ci_runner_projects", id: :serial, force: :cascade do |t|
866
    t.integer "runner_id", null: false
867 868
    t.datetime "created_at"
    t.datetime "updated_at"
869
    t.integer "project_id"
870 871
    t.index ["project_id"], name: "index_ci_runner_projects_on_project_id"
    t.index ["runner_id"], name: "index_ci_runner_projects_on_runner_id"
872 873
  end

Jasper Maes's avatar
Jasper Maes committed
874
  create_table "ci_runners", id: :serial, force: :cascade do |t|
875
    t.string "token"
876 877
    t.datetime "created_at"
    t.datetime "updated_at"
878
    t.string "description"
879
    t.datetime "contacted_at"
880 881 882 883 884 885 886 887 888
    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
889
    t.integer "access_level", default: 0, null: false
890
    t.string "ip_address"
891
    t.integer "maximum_timeout"
892
    t.integer "runner_type", limit: 2, null: false
893
    t.string "token_encrypted"
894 895 896 897 898 899
    t.index ["contacted_at"], name: "index_ci_runners_on_contacted_at"
    t.index ["is_shared"], name: "index_ci_runners_on_is_shared"
    t.index ["locked"], name: "index_ci_runners_on_locked"
    t.index ["runner_type"], name: "index_ci_runners_on_runner_type"
    t.index ["token"], name: "index_ci_runners_on_token"
    t.index ["token_encrypted"], name: "index_ci_runners_on_token_encrypted"
900 901
  end

Jasper Maes's avatar
Jasper Maes committed
902
  create_table "ci_sources_pipelines", id: :serial, force: :cascade do |t|
Kamil Trzciński's avatar
Kamil Trzciński committed
903 904 905 906 907
    t.integer "project_id"
    t.integer "pipeline_id"
    t.integer "source_project_id"
    t.integer "source_job_id"
    t.integer "source_pipeline_id"
908 909 910 911 912
    t.index ["pipeline_id"], name: "index_ci_sources_pipelines_on_pipeline_id"
    t.index ["project_id"], name: "index_ci_sources_pipelines_on_project_id"
    t.index ["source_job_id"], name: "index_ci_sources_pipelines_on_source_job_id"
    t.index ["source_pipeline_id"], name: "index_ci_sources_pipelines_on_source_pipeline_id"
    t.index ["source_project_id"], name: "index_ci_sources_pipelines_on_source_project_id"
Kamil Trzciński's avatar
Kamil Trzciński committed
913 914
  end

Jasper Maes's avatar
Jasper Maes committed
915
  create_table "ci_stages", id: :serial, force: :cascade do |t|
916 917 918 919
    t.integer "project_id"
    t.integer "pipeline_id"
    t.datetime "created_at"
    t.datetime "updated_at"
920
    t.string "name"
921
    t.integer "status"
922
    t.integer "lock_version"
923
    t.integer "position"
924 925 926 927
    t.index ["pipeline_id", "name"], name: "index_ci_stages_on_pipeline_id_and_name", unique: true
    t.index ["pipeline_id", "position"], name: "index_ci_stages_on_pipeline_id_and_position"
    t.index ["pipeline_id"], name: "index_ci_stages_on_pipeline_id"
    t.index ["project_id"], name: "index_ci_stages_on_project_id"
928 929
  end

930 931 932 933 934 935 936
  create_table "ci_subscriptions_projects", force: :cascade do |t|
    t.bigint "downstream_project_id", null: false
    t.bigint "upstream_project_id", null: false
    t.index ["downstream_project_id", "upstream_project_id"], name: "index_ci_subscriptions_projects_unique_subscription", unique: true
    t.index ["upstream_project_id"], name: "index_ci_subscriptions_projects_on_upstream_project_id"
  end

Jasper Maes's avatar
Jasper Maes committed
937
  create_table "ci_trigger_requests", id: :serial, force: :cascade do |t|
938 939
    t.integer "trigger_id", null: false
    t.text "variables"
940 941
    t.datetime "created_at"
    t.datetime "updated_at"
942
    t.integer "commit_id"
943
    t.index ["commit_id"], name: "index_ci_trigger_requests_on_commit_id"
944
    t.index ["trigger_id", "id"], name: "index_ci_trigger_requests_on_trigger_id_and_id", order: { id: :desc }
945 946
  end

Jasper Maes's avatar
Jasper Maes committed
947
  create_table "ci_triggers", id: :serial, force: :cascade do |t|
948
    t.string "token"
949 950
    t.datetime "created_at"
    t.datetime "updated_at"
951
    t.integer "project_id"
Kamil Trzciński's avatar
Kamil Trzciński committed
952 953
    t.integer "owner_id"
    t.string "description"
shinya maeda's avatar
shinya maeda committed
954
    t.string "ref"
955 956
    t.index ["owner_id"], name: "index_ci_triggers_on_owner_id"
    t.index ["project_id"], name: "index_ci_triggers_on_project_id"
957 958
  end

Jasper Maes's avatar
Jasper Maes committed
959
  create_table "ci_variables", id: :serial, force: :cascade do |t|
960
    t.string "key", null: false
961 962 963 964
    t.text "value"
    t.text "encrypted_value"
    t.string "encrypted_value_salt"
    t.string "encrypted_value_iv"
965
    t.integer "project_id", null: false
966
    t.boolean "protected", default: false, null: false
967
    t.string "environment_scope", default: "*", null: false
Matija Čupić's avatar
Matija Čupić committed
968
    t.boolean "masked", default: false, null: false
969
    t.integer "variable_type", limit: 2, default: 1, null: false
970
    t.index ["project_id", "key", "environment_scope"], name: "index_ci_variables_on_project_id_and_key_and_environment_scope", unique: true
971 972
  end

Jasper Maes's avatar
Jasper Maes committed
973
  create_table "cluster_groups", id: :serial, force: :cascade do |t|
974 975
    t.integer "cluster_id", null: false
    t.integer "group_id", null: false
976 977
    t.index ["cluster_id", "group_id"], name: "index_cluster_groups_on_cluster_id_and_group_id", unique: true
    t.index ["group_id"], name: "index_cluster_groups_on_group_id"
978 979
  end

Jasper Maes's avatar
Jasper Maes committed
980
  create_table "cluster_platforms_kubernetes", id: :serial, force: :cascade do |t|
Shinya Maeda's avatar
Shinya Maeda committed
981
    t.integer "cluster_id", null: false
982 983
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
Kamil Trzciński's avatar
Kamil Trzciński committed
984
    t.text "api_url"
Shinya Maeda's avatar
Shinya Maeda committed
985 986 987 988 989 990 991
    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"
992
    t.integer "authorization_type", limit: 2
993
    t.index ["cluster_id"], name: "index_cluster_platforms_kubernetes_on_cluster_id", unique: true
Shinya Maeda's avatar
Shinya Maeda committed
994 995
  end

Jasper Maes's avatar
Jasper Maes committed
996
  create_table "cluster_projects", id: :serial, force: :cascade do |t|
Shinya Maeda's avatar
Shinya Maeda committed
997 998
    t.integer "project_id", null: false
    t.integer "cluster_id", null: false
999 1000
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
1001 1002
    t.index ["cluster_id"], name: "index_cluster_projects_on_cluster_id"
    t.index ["project_id"], name: "index_cluster_projects_on_project_id"
Shinya Maeda's avatar
Shinya Maeda committed
1003 1004
  end

Tiger Watson's avatar
Tiger Watson committed
1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028
  create_table "cluster_providers_aws", force: :cascade do |t|
    t.bigint "cluster_id", null: false
    t.integer "created_by_user_id"
    t.integer "num_nodes", null: false
    t.integer "status", null: false
    t.datetime_with_timezone "created_at", null: false
    t.datetime_with_timezone "updated_at", null: false
    t.string "key_name", limit: 255, null: false
    t.string "role_arn", limit: 2048, null: false
    t.string "region", limit: 255, null: false
    t.string "vpc_id", limit: 255, null: false
    t.string "subnet_ids", limit: 255, default: [], null: false, array: true
    t.string "security_group_id", limit: 255, null: false
    t.string "instance_type", limit: 255, null: false
    t.string "access_key_id", limit: 255
    t.string "encrypted_secret_access_key_iv", limit: 255
    t.text "encrypted_secret_access_key"
    t.text "session_token"
    t.text "status_reason"
    t.index ["cluster_id", "status"], name: "index_cluster_providers_aws_on_cluster_id_and_status"
    t.index ["cluster_id"], name: "index_cluster_providers_aws_on_cluster_id", unique: true
    t.index ["created_by_user_id"], name: "index_cluster_providers_aws_on_created_by_user_id"
  end

Jasper Maes's avatar
Jasper Maes committed
1029
  create_table "cluster_providers_gcp", id: :serial, force: :cascade do |t|
Shinya Maeda's avatar
Shinya Maeda committed
1030 1031
    t.integer "cluster_id", null: false
    t.integer "status"
Kamil Trzciński's avatar
Kamil Trzciński committed
1032
    t.integer "num_nodes", null: false
1033 1034
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
Shinya Maeda's avatar
Shinya Maeda committed
1035 1036 1037 1038 1039 1040 1041 1042
    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"
1043
    t.boolean "legacy_abac", default: false, null: false
1044 1045
    t.boolean "cloud_run", default: false, null: false
    t.index ["cloud_run"], name: "index_cluster_providers_gcp_on_cloud_run"
1046
    t.index ["cluster_id"], name: "index_cluster_providers_gcp_on_cluster_id", unique: true
Shinya Maeda's avatar
Shinya Maeda committed
1047 1048
  end

Jasper Maes's avatar
Jasper Maes committed
1049
  create_table "clusters", id: :serial, force: :cascade do |t|
1050
    t.integer "user_id"
Kamil Trzciński's avatar
Kamil Trzciński committed
1051 1052
    t.integer "provider_type"
    t.integer "platform_type"
1053 1054
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
1055 1056
    t.boolean "enabled", default: true
    t.string "name", null: false
1057
    t.string "environment_scope", default: "*", null: false
1058
    t.integer "cluster_type", limit: 2, default: 3, null: false
1059
    t.string "domain"
1060
    t.boolean "managed", default: true, null: false
1061
    t.boolean "namespace_per_environment", default: true, null: false
1062
    t.integer "management_project_id"
1063 1064
    t.integer "cleanup_status", limit: 2, default: 1, null: false
    t.text "cleanup_status_reason"
1065
    t.index ["enabled"], name: "index_clusters_on_enabled"
1066
    t.index ["management_project_id"], name: "index_clusters_on_management_project_id", where: "(management_project_id IS NOT NULL)"
1067
    t.index ["user_id"], name: "index_clusters_on_user_id"
Shinya Maeda's avatar
Shinya Maeda committed
1068 1069
  end

Jasper Maes's avatar
Jasper Maes committed
1070
  create_table "clusters_applications_cert_managers", id: :serial, force: :cascade do |t|
1071 1072 1073 1074 1075 1076 1077
    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"
1078
    t.index ["cluster_id"], name: "index_clusters_applications_cert_managers_on_cluster_id", unique: true
1079 1080
  end

1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091
  create_table "clusters_applications_crossplane", id: :serial, force: :cascade do |t|
    t.datetime_with_timezone "created_at", null: false
    t.datetime_with_timezone "updated_at", null: false
    t.bigint "cluster_id", null: false
    t.integer "status", null: false
    t.string "version", limit: 255, null: false
    t.string "stack", limit: 255, null: false
    t.text "status_reason"
    t.index ["cluster_id"], name: "index_clusters_applications_crossplane_on_cluster_id", unique: true
  end

1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102
  create_table "clusters_applications_elastic_stacks", force: :cascade do |t|
    t.datetime_with_timezone "created_at", null: false
    t.datetime_with_timezone "updated_at", null: false
    t.bigint "cluster_id", null: false
    t.integer "status", null: false
    t.string "version", limit: 255, null: false
    t.string "kibana_hostname", limit: 255
    t.text "status_reason"
    t.index ["cluster_id"], name: "index_clusters_applications_elastic_stacks_on_cluster_id", unique: true
  end

Jasper Maes's avatar
Jasper Maes committed
1103
  create_table "clusters_applications_helm", id: :serial, force: :cascade do |t|