schema.rb 205 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

Heinrich Lee Yu's avatar
Heinrich Lee Yu committed
13
ActiveRecord::Schema.define(version: 2019_07_03_130053) do
14

Kamil Trzcinski's avatar
Kamil Trzcinski committed
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"
Kamil Trzcinski's avatar
Kamil Trzcinski committed
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
28
  end

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

Jasper Maes's avatar
Jasper Maes committed
51
  create_table "application_setting_terms", id: :serial, force: :cascade do |t|
52
53
54
55
56
    t.integer "cached_markdown_version"
    t.text "terms", null: false
    t.text "terms_html"
  end

Jasper Maes's avatar
Jasper Maes committed
57
  create_table "application_settings", id: :serial, force: :cascade do |t|
58
59
60
61
    t.integer "default_projects_limit"
    t.boolean "signup_enabled"
    t.boolean "gravatar_enabled"
    t.text "sign_in_text"
62
63
    t.datetime "created_at"
    t.datetime "updated_at"
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
    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"
81
    t.integer "max_pages_size", default: 100, null: false
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
    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"
Valery Sizov's avatar
Valery Sizov committed
106
    t.boolean "user_default_external", default: false, null: false
107
    t.string "repository_storages", default: "default"
108
109
110
    t.string "enabled_git_access_protocol"
    t.boolean "domain_blacklist_enabled", default: false
    t.text "domain_blacklist"
111
    t.boolean "usage_ping_enabled", default: true, null: false
112
113
114
115
    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"
116
    t.integer "rsa_key_restriction", default: 0, null: false
117
    t.integer "dsa_key_restriction", default: -1, null: false
118
119
    t.integer "ecdsa_key_restriction", default: 0, null: false
    t.integer "ed25519_key_restriction", default: 0, null: false
Jacob Vosmaer's avatar
Jacob Vosmaer committed
120
121
122
123
124
    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
125
    t.boolean "html_emails_enabled", default: true
126
127
    t.string "plantuml_url"
    t.boolean "plantuml_enabled"
128
    t.integer "terminal_max_session_time", default: 0, null: false
129
130
131
    t.integer "unique_ips_limit_per_user"
    t.integer "unique_ips_limit_time_window"
    t.boolean "unique_ips_limit_enabled", default: false, null: false
132
133
    t.string "default_artifacts_expire_in", default: "0", null: false
    t.string "uuid"
134
    t.decimal "polling_interval_multiplier", default: "1.0", null: false
135
    t.integer "cached_markdown_version"
136
    t.boolean "prometheus_metrics_enabled", default: true, null: false
137
138
    t.boolean "help_page_hide_commercial_content", default: false
    t.string "help_page_support_url"
139
    t.integer "performance_bar_allowed_group_id"
140
    t.boolean "hashed_storage_enabled", default: true, null: false
141
    t.boolean "project_export_enabled", default: true, null: false
142
    t.boolean "auto_devops_enabled", default: true, null: false
143
144
145
146
147
148
149
150
151
    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
152
    t.boolean "password_authentication_enabled_for_web"
153
    t.boolean "password_authentication_enabled_for_git", default: true, null: false
154
155
156
    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
157
    t.boolean "authorized_keys_enabled", default: true, null: false
158
    t.string "auto_devops_domain"
159
    t.boolean "pages_domain_verification_enabled", default: true, null: false
160
    t.string "user_default_internal_regex"
161
    t.boolean "allow_local_requests_from_hooks_and_services", default: false, null: false
162
    t.boolean "enforce_terms", default: false
163
    t.boolean "mirror_available", default: true, null: false
164
    t.boolean "hide_third_party_offers", default: false, null: false
165
    t.boolean "instance_statistics_visibility_private", default: false, null: false
Phil Hughes's avatar
Phil Hughes committed
166
    t.boolean "web_ide_clientside_preview_enabled", default: false, null: false
167
    t.boolean "user_show_add_ssh_key_message", default: true, null: false
168
    t.integer "usage_stats_set_by_user_id"
169
    t.integer "receive_max_input_size"
170
    t.integer "diff_max_patch_bytes", default: 102400, null: false
171
    t.integer "archive_builds_in_seconds"
172
    t.string "commit_email_hostname"
173
    t.boolean "protected_ci_variables", default: false, null: false
174
    t.string "runners_registration_token_encrypted"
Jan Provaznik's avatar
Jan Provaznik committed
175
    t.integer "local_markdown_version", default: 0, null: false
176
    t.integer "first_day_of_week", default: 0, null: false
Gosia Ksionek's avatar
Gosia Ksionek committed
177
    t.integer "default_project_creation", default: 2, null: false
178
179
180
181
182
183
184
185
186
    t.boolean "external_authorization_service_enabled", default: false, null: false
    t.string "external_authorization_service_url"
    t.string "external_authorization_service_default_label"
    t.float "external_authorization_service_timeout", default: 0.5
    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"
187
188
    t.string "lets_encrypt_notification_email"
    t.boolean "lets_encrypt_terms_of_service_accepted", default: false, null: false
189
190
    t.integer "elasticsearch_shards", default: 5, null: false
    t.integer "elasticsearch_replicas", default: 1, null: false
191
192
    t.text "encrypted_lets_encrypt_private_key"
    t.text "encrypted_lets_encrypt_private_key_iv"
Matija Čupić's avatar
Matija Čupić committed
193
    t.string "required_instance_ci_template"
194
    t.boolean "dns_rebinding_protection_enabled", default: true, null: false
Małgorzata Ksionek's avatar
Małgorzata Ksionek committed
195
    t.boolean "default_project_deletion_protection", default: false, null: false
196
    t.boolean "grafana_enabled", default: false, null: false
197
    t.boolean "lock_memberships_to_ldap", default: false, null: false
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
    t.text "help_text"
    t.boolean "elasticsearch_indexing", default: false, null: false
    t.boolean "elasticsearch_search", default: false, null: false
    t.integer "shared_runners_minutes", default: 0, null: false
    t.bigint "repository_size_limit", default: 0
    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"
    t.integer "geo_status_timeout", default: 10
    t.boolean "elasticsearch_experimental_indexer"
    t.boolean "check_namespace_plan", default: false, null: false
    t.integer "mirror_max_delay", default: 300, null: false
    t.integer "mirror_max_capacity", default: 100, null: false
    t.integer "mirror_capacity_threshold", default: 50, null: false
    t.boolean "slack_app_enabled", default: false
    t.string "slack_app_id"
    t.string "slack_app_secret"
    t.string "slack_app_verification_token"
    t.boolean "allow_group_owners_to_manage_ldap", default: true, null: false
    t.string "email_additional_text"
    t.integer "file_template_project_id"
    t.boolean "pseudonymizer_enabled", default: false, null: false
    t.boolean "snowplow_enabled", default: false, null: false
    t.string "snowplow_collector_uri"
    t.string "snowplow_site_id"
    t.string "snowplow_cookie_domain"
    t.integer "custom_project_templates_group_id"
    t.boolean "elasticsearch_limit_indexing", default: false, null: false
    t.string "geo_node_allowed_ips", default: "0.0.0.0/0, ::/0"
229
    t.boolean "time_tracking_limit_to_hours", default: false, null: false
230
    t.string "grafana_url", default: "/-/grafana", null: false
231
232
    t.index ["custom_project_templates_group_id"], name: "index_application_settings_on_custom_project_templates_group_id", using: :btree
    t.index ["file_template_project_id"], name: "index_application_settings_on_file_template_project_id", using: :btree
233
    t.index ["usage_stats_set_by_user_id"], name: "index_application_settings_on_usage_stats_set_by_user_id", using: :btree
234
235
  end

236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
  create_table "approval_merge_request_rule_sources", force: :cascade do |t|
    t.bigint "approval_merge_request_rule_id", null: false
    t.bigint "approval_project_rule_id", null: false
    t.index ["approval_merge_request_rule_id"], name: "index_approval_merge_request_rule_sources_1", unique: true, using: :btree
    t.index ["approval_project_rule_id"], name: "index_approval_merge_request_rule_sources_2", using: :btree
  end

  create_table "approval_merge_request_rules", force: :cascade do |t|
    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
    t.integer "rule_type", limit: 2, default: 1, null: false
251
    t.integer "report_type", limit: 2
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
    t.index ["merge_request_id", "code_owner", "name"], name: "approval_rule_name_index_for_code_owners", unique: true, where: "(code_owner = true)", using: :btree
    t.index ["merge_request_id", "code_owner"], name: "index_approval_merge_request_rules_1", using: :btree
    t.index ["merge_request_id", "rule_type", "name"], name: "index_approval_rule_name_for_code_owners_rule_type", unique: true, where: "(rule_type = 2)", using: :btree
    t.index ["merge_request_id", "rule_type"], name: "index_approval_rules_code_owners_rule_type", where: "(rule_type = 2)", using: :btree
  end

  create_table "approval_merge_request_rules_approved_approvers", force: :cascade do |t|
    t.bigint "approval_merge_request_rule_id", null: false
    t.integer "user_id", null: false
    t.index ["approval_merge_request_rule_id", "user_id"], name: "index_approval_merge_request_rules_approved_approvers_1", unique: true, using: :btree
    t.index ["user_id"], name: "index_approval_merge_request_rules_approved_approvers_2", using: :btree
  end

  create_table "approval_merge_request_rules_groups", force: :cascade do |t|
    t.bigint "approval_merge_request_rule_id", null: false
    t.integer "group_id", null: false
    t.index ["approval_merge_request_rule_id", "group_id"], name: "index_approval_merge_request_rules_groups_1", unique: true, using: :btree
    t.index ["group_id"], name: "index_approval_merge_request_rules_groups_2", using: :btree
  end

  create_table "approval_merge_request_rules_users", force: :cascade do |t|
    t.bigint "approval_merge_request_rule_id", null: false
    t.integer "user_id", null: false
    t.index ["approval_merge_request_rule_id", "user_id"], name: "index_approval_merge_request_rules_users_1", unique: true, using: :btree
    t.index ["user_id"], name: "index_approval_merge_request_rules_users_2", using: :btree
  end

  create_table "approval_project_rules", force: :cascade do |t|
    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
    t.index ["project_id"], name: "index_approval_project_rules_on_project_id", using: :btree
  end

  create_table "approval_project_rules_groups", force: :cascade do |t|
    t.bigint "approval_project_rule_id", null: false
    t.integer "group_id", null: false
    t.index ["approval_project_rule_id", "group_id"], name: "index_approval_project_rules_groups_1", unique: true, using: :btree
    t.index ["group_id"], name: "index_approval_project_rules_groups_2", using: :btree
  end

  create_table "approval_project_rules_users", force: :cascade do |t|
    t.bigint "approval_project_rule_id", null: false
    t.integer "user_id", null: false
    t.index ["approval_project_rule_id", "user_id"], name: "index_approval_project_rules_users_1", unique: true, using: :btree
    t.index ["user_id"], name: "index_approval_project_rules_users_2", using: :btree
  end

  create_table "approvals", id: :serial, force: :cascade do |t|
    t.integer "merge_request_id", null: false
    t.integer "user_id", null: false
    t.datetime "created_at"
    t.datetime "updated_at"
    t.index ["merge_request_id"], name: "index_approvals_on_merge_request_id", using: :btree
    t.index ["user_id", "merge_request_id"], name: "index_approvals_on_user_id_and_merge_request_id", unique: true, using: :btree
  end

  create_table "approver_groups", id: :serial, force: :cascade do |t|
    t.integer "target_id", null: false
    t.string "target_type", null: false
    t.integer "group_id", null: false
    t.datetime "created_at"
    t.datetime "updated_at"
    t.index ["group_id"], name: "index_approver_groups_on_group_id", using: :btree
    t.index ["target_id", "target_type"], name: "index_approver_groups_on_target_id_and_target_type", using: :btree
  end

  create_table "approvers", id: :serial, force: :cascade do |t|
    t.integer "target_id", null: false
    t.string "target_type"
    t.integer "user_id", null: false
    t.datetime "created_at"
    t.datetime "updated_at"
    t.index ["target_id", "target_type"], name: "index_approvers_on_target_id_and_target_type", using: :btree
    t.index ["user_id"], name: "index_approvers_on_user_id", using: :btree
  end

Jasper Maes's avatar
Jasper Maes committed
331
  create_table "audit_events", id: :serial, force: :cascade do |t|
332
333
334
335
336
    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"
337
338
    t.datetime "created_at"
    t.datetime "updated_at"
339
    t.index ["created_at", "author_id"], name: "analytics_index_audit_events_on_created_at_and_author_id", using: :btree
340
    t.index ["entity_id", "entity_type"], name: "index_audit_events_on_entity_id_and_entity_type", using: :btree
341
342
  end

Jasper Maes's avatar
Jasper Maes committed
343
  create_table "award_emoji", id: :serial, force: :cascade do |t|
344
345
346
347
    t.string "name"
    t.integer "user_id"
    t.integer "awardable_id"
    t.string "awardable_type"
348
349
    t.datetime "created_at"
    t.datetime "updated_at"
350
351
    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
352
353
  end

Jasper Maes's avatar
Jasper Maes committed
354
  create_table "badges", id: :serial, force: :cascade do |t|
355
356
357
358
359
360
361
    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
362
363
    t.index ["group_id"], name: "index_badges_on_group_id", using: :btree
    t.index ["project_id"], name: "index_badges_on_project_id", using: :btree
364
365
  end

366
367
368
369
370
371
372
  create_table "board_assignees", id: :serial, force: :cascade do |t|
    t.integer "board_id", null: false
    t.integer "assignee_id", null: false
    t.index ["assignee_id"], name: "index_board_assignees_on_assignee_id", using: :btree
    t.index ["board_id", "assignee_id"], name: "index_board_assignees_on_board_id_and_assignee_id", unique: true, using: :btree
  end

Jasper Maes's avatar
Jasper Maes committed
373
  create_table "board_group_recent_visits", force: :cascade do |t|
374
375
376
377
378
    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"
379
380
381
382
    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
383
384
  end

385
386
387
388
389
390
391
  create_table "board_labels", id: :serial, force: :cascade do |t|
    t.integer "board_id", null: false
    t.integer "label_id", null: false
    t.index ["board_id", "label_id"], name: "index_board_labels_on_board_id_and_label_id", unique: true, using: :btree
    t.index ["label_id"], name: "index_board_labels_on_label_id", using: :btree
  end

Jasper Maes's avatar
Jasper Maes committed
392
  create_table "board_project_recent_visits", force: :cascade do |t|
393
394
395
396
397
    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"
398
399
400
401
    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
402
403
  end

Jasper Maes's avatar
Jasper Maes committed
404
  create_table "boards", id: :serial, force: :cascade do |t|
Felipe Artur's avatar
Felipe Artur committed
405
    t.integer "project_id"
Douglas Barbosa Alexandre's avatar
Douglas Barbosa Alexandre committed
406
407
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
Felipe Artur's avatar
Felipe Artur committed
408
    t.integer "group_id"
409
410
411
    t.integer "milestone_id"
    t.integer "weight"
    t.string "name", default: "Development", null: false
412
    t.index ["group_id"], name: "index_boards_on_group_id", using: :btree
413
    t.index ["milestone_id"], name: "index_boards_on_milestone_id", using: :btree
414
    t.index ["project_id"], name: "index_boards_on_project_id", using: :btree
Douglas Barbosa Alexandre's avatar
Douglas Barbosa Alexandre committed
415
416
  end

Jasper Maes's avatar
Jasper Maes committed
417
  create_table "broadcast_messages", id: :serial, force: :cascade do |t|
418
    t.text "message", null: false
419
420
421
422
    t.datetime "starts_at", null: false
    t.datetime "ends_at", null: false
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
423
424
    t.string "color"
    t.string "font"
425
    t.text "message_html", null: false
426
    t.integer "cached_markdown_version"
427
    t.index ["starts_at", "ends_at", "id"], name: "index_broadcast_messages_on_starts_at_and_ends_at_and_id", using: :btree
428
  end
429

Jasper Maes's avatar
Jasper Maes committed
430
  create_table "chat_names", id: :serial, force: :cascade do |t|
431
432
    t.integer "user_id", null: false
    t.integer "service_id", null: false
433
    t.string "team_id", null: false
434
    t.string "team_domain"
435
    t.string "chat_id", null: false
436
    t.string "chat_name"
437
    t.datetime "last_used_at"
438
439
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
440
441
    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
442
  end
443

Jasper Maes's avatar
Jasper Maes committed
444
  create_table "chat_teams", id: :serial, force: :cascade do |t|
445
    t.integer "namespace_id", null: false
446
447
448
449
    t.string "team_id"
    t.string "name"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
450
    t.index ["namespace_id"], name: "index_chat_teams_on_namespace_id", unique: true, using: :btree
Douwe Maan's avatar
Douwe Maan committed
451
452
  end

Jasper Maes's avatar
Jasper Maes committed
453
  create_table "ci_build_trace_chunks", force: :cascade do |t|
454
455
456
457
    t.integer "build_id", null: false
    t.integer "chunk_index", null: false
    t.integer "data_store", null: false
    t.binary "raw_data"
458
    t.index ["build_id", "chunk_index"], name: "index_ci_build_trace_chunks_on_build_id_and_chunk_index", unique: true, using: :btree
459
460
  end

Jasper Maes's avatar
Jasper Maes committed
461
  create_table "ci_build_trace_section_names", id: :serial, force: :cascade do |t|
462
463
    t.integer "project_id", null: false
    t.string "name", null: false
464
    t.index ["project_id", "name"], name: "index_ci_build_trace_section_names_on_project_id_and_name", unique: true, using: :btree
465
466
  end

Jasper Maes's avatar
Jasper Maes committed
467
  create_table "ci_build_trace_sections", id: :serial, force: :cascade do |t|
Alessio Caiazza's avatar
Alessio Caiazza committed
468
    t.integer "project_id", null: false
469
470
    t.datetime_with_timezone "date_start", null: false
    t.datetime_with_timezone "date_end", null: false
471
472
    t.bigint "byte_start", null: false
    t.bigint "byte_end", null: false
473
474
    t.integer "build_id", null: false
    t.integer "section_name_id", null: false
475
476
477
    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
478
479
  end

Jasper Maes's avatar
Jasper Maes committed
480
  create_table "ci_builds", id: :serial, force: :cascade do |t|
481
    t.string "status"
Douwe Maan's avatar
Douwe Maan committed
482
    t.datetime "finished_at"
483
    t.text "trace"
Douwe Maan's avatar
Douwe Maan committed
484
485
486
    t.datetime "created_at"
    t.datetime "updated_at"
    t.datetime "started_at"
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
    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"
Kamil Trzciński's avatar
Kamil Trzciński committed
504
    t.integer "project_id"
505
506
    t.text "artifacts_metadata"
    t.integer "erased_by_id"
507
    t.datetime "erased_at"
508
    t.datetime "artifacts_expire_at"
509
    t.string "environment"
510
    t.bigint "artifacts_size"
511
512
    t.string "when"
    t.text "yaml_variables"
513
    t.datetime "queued_at"
514
    t.string "token"
Kamil Trzcinski's avatar
Kamil Trzcinski committed
515
    t.integer "lock_version"
516
    t.string "coverage_regex"
517
    t.integer "auto_canceled_by_id"
Kamil Trzcinski's avatar
Kamil Trzcinski committed
518
    t.boolean "retried"
519
    t.integer "stage_id"
520
521
    t.integer "artifacts_file_store"
    t.integer "artifacts_metadata_store"
522
    t.boolean "protected"
523
    t.integer "failure_reason"
524
    t.datetime_with_timezone "scheduled_at"
Kamil Trzciński's avatar
Kamil Trzciński committed
525
    t.string "token_encrypted"
526
    t.integer "upstream_pipeline_id"
527
528
    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
Andreas Brandl's avatar
Andreas Brandl committed
529
    t.index ["commit_id", "artifacts_expire_at", "id"], name: "index_ci_builds_on_commit_id_and_artifacts_expireatandidpartial", where: "(((type)::text = 'Ci::Build'::text) AND ((retried = false) OR (retried IS NULL)) AND ((name)::text = ANY (ARRAY[('sast'::character varying)::text, ('dependency_scanning'::character varying)::text, ('sast:container'::character varying)::text, ('container_scanning'::character varying)::text, ('dast'::character varying)::text])))", using: :btree
530
531
532
533
    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
534
    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]))", using: :btree
535
    t.index ["project_id", "id"], name: "index_ci_builds_on_project_id_and_id", using: :btree
536
    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
537
    t.index ["protected"], name: "index_ci_builds_on_protected", using: :btree
538
    t.index ["queued_at"], name: "index_ci_builds_on_queued_at", using: :btree
539
540
541
542
543
544
    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
Kamil Trzciński's avatar
Kamil Trzciński committed
545
    t.index ["token_encrypted"], name: "index_ci_builds_on_token_encrypted", unique: true, where: "(token_encrypted IS NOT NULL)", using: :btree
546
    t.index ["updated_at"], name: "index_ci_builds_on_updated_at", using: :btree
547
    t.index ["upstream_pipeline_id"], name: "index_ci_builds_on_upstream_pipeline_id", where: "(upstream_pipeline_id IS NOT NULL)", using: :btree
548
    t.index ["user_id"], name: "index_ci_builds_on_user_id", using: :btree
Douwe Maan's avatar
Douwe Maan committed
549
550
  end

Jasper Maes's avatar
Jasper Maes committed
551
  create_table "ci_builds_metadata", id: :serial, force: :cascade do |t|
552
    t.integer "build_id", null: false
553
    t.integer "project_id", null: false
554
    t.integer "timeout"
555
    t.integer "timeout_source", default: 1, null: false
556
557
    t.jsonb "config_options"
    t.jsonb "config_variables"
558
559
    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
560
561
  end

Jasper Maes's avatar
Jasper Maes committed
562
  create_table "ci_builds_runner_session", force: :cascade do |t|
563
564
565
566
    t.integer "build_id", null: false
    t.string "url", null: false
    t.string "certificate"
    t.string "authorization"
567
    t.index ["build_id"], name: "index_ci_builds_runner_session_on_build_id", unique: true, using: :btree
568
569
  end

Jasper Maes's avatar
Jasper Maes committed
570
  create_table "ci_group_variables", id: :serial, force: :cascade do |t|
571
572
573
574
575
    t.string "key", null: false
    t.text "value"
    t.text "encrypted_value"
    t.string "encrypted_value_salt"
    t.string "encrypted_value_iv"
Shinya Maeda's avatar
fix    
Shinya Maeda committed
576
577
    t.integer "group_id", null: false
    t.boolean "protected", default: false, null: false
578
579
    t.datetime_with_timezone "created_at", null: false
    t.datetime_with_timezone "updated_at", null: false
580
    t.boolean "masked", default: false, null: false
581
    t.integer "variable_type", limit: 2, default: 1, null: false
582
    t.index ["group_id", "key"], name: "index_ci_group_variables_on_group_id_and_key", unique: true, using: :btree
583
584
  end

Jasper Maes's avatar
Jasper Maes committed
585
  create_table "ci_job_artifacts", id: :serial, force: :cascade do |t|
586
    t.integer "project_id", null: false
Zeger-Jan van de Weg's avatar
Zeger-Jan van de Weg committed
587
    t.integer "job_id", null: false
588
    t.integer "file_type", null: false
589
    t.integer "file_store"
590
    t.bigint "size"
591
592
    t.datetime_with_timezone "created_at", null: false
    t.datetime_with_timezone "updated_at", null: false
593
    t.datetime_with_timezone "expire_at"
594
    t.string "file"
595
    t.binary "file_sha256"
596
    t.integer "file_format", limit: 2
597
    t.integer "file_location", limit: 2
598
599
600
601
    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
602
603
  end

Jasper Maes's avatar
Jasper Maes committed
604
  create_table "ci_pipeline_chat_data", force: :cascade do |t|
605
606
607
608
609
610
611
    t.integer "pipeline_id", null: false
    t.integer "chat_name_id", null: false
    t.text "response_url", null: false
    t.index ["chat_name_id"], name: "index_ci_pipeline_chat_data_on_chat_name_id", using: :btree
    t.index ["pipeline_id"], name: "index_ci_pipeline_chat_data_on_pipeline_id", unique: true, using: :btree
  end

Shinya Maeda's avatar
fix    
Shinya Maeda committed
612
  create_table "ci_pipeline_schedule_variables", force: :cascade do |t|
Shinya Maeda's avatar
Shinya Maeda committed
613
614
615
616
617
    t.string "key", null: false
    t.text "value"
    t.text "encrypted_value"
    t.string "encrypted_value_salt"
    t.string "encrypted_value_iv"
Shinya Maeda's avatar
fix    
Shinya Maeda committed
618
    t.integer "pipeline_schedule_id", null: false
619
620
    t.datetime_with_timezone "created_at"
    t.datetime_with_timezone "updated_at"
621
    t.integer "variable_type", limit: 2, default: 1, null: false
622
    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
623
624
  end

Jasper Maes's avatar
Jasper Maes committed
625
  create_table "ci_pipeline_schedules", id: :serial, force: :cascade do |t|
626
627
628
629
630
631
632
633
    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
Douwe Maan's avatar
Douwe Maan committed
634
635
    t.datetime "created_at"
    t.datetime "updated_at"
636
    t.index ["next_run_at", "active"], name: "index_ci_pipeline_schedules_on_next_run_at_and_active", using: :btree
637
    t.index ["owner_id"], name: "index_ci_pipeline_schedules_on_owner_id", using: :btree
638
    t.index ["project_id"], name: "index_ci_pipeline_schedules_on_project_id", using: :btree
Douwe Maan's avatar
Douwe Maan committed
639
640
  end

Jasper Maes's avatar
Jasper Maes committed
641
  create_table "ci_pipeline_variables", id: :serial, force: :cascade do |t|
Shinya Maeda's avatar
init    
Shinya Maeda committed
642
643
644
645
646
647
    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
648
    t.integer "variable_type", limit: 2, default: 1, null: false
649
    t.index ["pipeline_id", "key"], name: "index_ci_pipeline_variables_on_pipeline_id_and_key", unique: true, using: :btree
Shinya Maeda's avatar
init    
Shinya Maeda committed
650
651
  end

Jasper Maes's avatar
Jasper Maes committed
652
  create_table "ci_pipelines", id: :serial, force: :cascade do |t|
653
654
655
    t.string "ref"
    t.string "sha"
    t.string "before_sha"
Douwe Maan's avatar
Douwe Maan committed
656
657
    t.datetime "created_at"
    t.datetime "updated_at"
658
659
    t.boolean "tag", default: false
    t.text "yaml_errors"
Douwe Maan's avatar
Douwe Maan committed
660
    t.datetime "committed_at"
Kamil Trzciński's avatar
Kamil Trzciński committed
661
    t.integer "project_id"
662
    t.string "status"
663
664
    t.datetime "started_at"
    t.datetime "finished_at"
665
666
    t.integer "duration"
    t.integer "user_id"
Kamil Trzcinski's avatar
Kamil Trzcinski committed
667
    t.integer "lock_version"
668
    t.integer "auto_canceled_by_id"
669
    t.integer "pipeline_schedule_id"
670
    t.integer "source"
Kamil Trzcinski's avatar
Kamil Trzcinski committed
671
    t.integer "config_source"
672
    t.boolean "protected"
673
    t.integer "failure_reason"
Shinya Maeda's avatar
Shinya Maeda committed
674
    t.integer "iid"
Shinya Maeda's avatar
Shinya Maeda committed
675
    t.integer "merge_request_id"
676
677
    t.binary "source_sha"
    t.binary "target_sha"
678
    t.index ["auto_canceled_by_id"], name: "index_ci_pipelines_on_auto_canceled_by_id", using: :btree
Shinya Maeda's avatar
Shinya Maeda committed
679
    t.index ["merge_request_id"], name: "index_ci_pipelines_on_merge_request_id", where: "(merge_request_id IS NOT NULL)", using: :btree
680
681
    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
Andreas Brandl's avatar
Andreas Brandl committed
682
    t.index ["project_id", "ref", "id"], name: "index_ci_pipelines_on_project_idandrefandiddesc", order: { id: :desc }, using: :btree
683
684
685
686
687
688
689
    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
Douwe Maan's avatar
Douwe Maan committed
690
691
  end

Jasper Maes's avatar
Jasper Maes committed
692
  create_table "ci_runner_namespaces", id: :serial, force: :cascade do |t|
Alexis Reigel's avatar
Alexis Reigel committed
693
    t.integer "runner_id"
694
    t.integer "namespace_id"
695
696
    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
Alexis Reigel's avatar
Alexis Reigel committed
697
698
  end

Jasper Maes's avatar
Jasper Maes committed
699
  create_table "ci_runner_projects", id: :serial, force: :cascade do |t|
700
    t.integer "runner_id", null: false
Douwe Maan's avatar
Douwe Maan committed
701
702
    t.datetime "created_at"
    t.datetime "updated_at"
Kamil Trzciński's avatar
Kamil Trzciński committed
703
    t.integer "project_id"
704
705
    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
Douwe Maan's avatar
Douwe Maan committed
706
707
  end

Jasper Maes's avatar
Jasper Maes committed
708
  create_table "ci_runners", id: :serial, force: :cascade do |t|
709
    t.string "token"
Douwe Maan's avatar
Douwe Maan committed
710
711
    t.datetime "created_at"
    t.datetime "updated_at"
712
    t.string "description"
Douwe Maan's avatar
Douwe Maan committed
713
    t.datetime "contacted_at"
714
715
716
717
718
719
720
721
722
    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
723
    t.integer "access_level", default: 0, null: false
724
    t.string "ip_address"
725
    t.integer "maximum_timeout"
726
    t.integer "runner_type", limit: 2, null: false
727
    t.string "token_encrypted"
728
729
730
731
732
    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
Kamil Trzciński's avatar
Kamil Trzciński committed
733
    t.index ["token_encrypted"], name: "index_ci_runners_on_token_encrypted", using: :btree
Douwe Maan's avatar
Douwe Maan committed
734
735
  end

736
737
738
739
740
741
742
743
744
745
746
747
748
  create_table "ci_sources_pipelines", id: :serial, force: :cascade do |t|
    t.integer "project_id"
    t.integer "pipeline_id"
    t.integer "source_project_id"
    t.integer "source_job_id"
    t.integer "source_pipeline_id"
    t.index ["pipeline_id"], name: "index_ci_sources_pipelines_on_pipeline_id", using: :btree
    t.index ["project_id"], name: "index_ci_sources_pipelines_on_project_id", using: :btree
    t.index ["source_job_id"], name: "index_ci_sources_pipelines_on_source_job_id", using: :btree
    t.index ["source_pipeline_id"], name: "index_ci_sources_pipelines_on_source_pipeline_id", using: :btree
    t.index ["source_project_id"], name: "index_ci_sources_pipelines_on_source_project_id", using: :btree
  end

Jasper Maes's avatar
Jasper Maes committed
749
  create_table "ci_stages", id: :serial, force: :cascade do |t|
750
751
    t.integer "project_id"
    t.integer "pipeline_id"
Douwe Maan's avatar
Douwe Maan committed
752
753
    t.datetime "created_at"
    t.datetime "updated_at"
754
    t.string "name"
755
    t.integer "status"
756
    t.integer "lock_version"
757
    t.integer "position"
758
759
760
761
    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
Douwe Maan's avatar
Douwe Maan committed
762
763
  end

Jasper Maes's avatar
Jasper Maes committed
764
  create_table "ci_trigger_requests", id: :serial, force: :cascade do |t|
765
766
    t.integer "trigger_id", null: false
    t.text "variables"
Douwe Maan's avatar
Douwe Maan committed
767
768
    t.datetime "created_at"
    t.datetime "updated_at"
769
    t.integer "commit_id"
770
    t.index ["commit_id"], name: "index_ci_trigger_requests_on_commit_id", using: :btree
771
    t.index ["trigger_id"], name: "index_ci_trigger_requests_on_trigger_id", using: :btree
Douwe Maan's avatar
Douwe Maan committed
772
773
  end

Jasper Maes's avatar
Jasper Maes committed
774
  create_table "ci_triggers", id: :serial, force: :cascade do |t|
775
    t.string "token"
Douwe Maan's avatar
Douwe Maan committed
776
777
    t.datetime "created_at"
    t.datetime "updated_at"
Kamil Trzciński's avatar
Kamil Trzciński committed
778
    t.integer "project_id"
Kamil Trzcinski's avatar
Kamil Trzcinski committed
779
780
    t.integer "owner_id"
    t.string "description"
Shinya Maeda's avatar
Shinya Maeda committed
781
    t.string "ref"
782
    t.index ["owner_id"], name: "index_ci_triggers_on_owner_id", using: :btree
783
    t.index ["project_id"], name: "index_ci_triggers_on_project_id", using: :btree
Douwe Maan's avatar
Douwe Maan committed
784
785
  end

Jasper Maes's avatar
Jasper Maes committed
786
  create_table "ci_variables", id: :serial, force: :cascade do |t|
787
    t.string "key", null: false
788
789
790
791
    t.text "value"
    t.text "encrypted_value"
    t.string "encrypted_value_salt"
    t.string "encrypted_value_iv"
792
    t.integer "project_id", null: false
793
    t.boolean "protected", default: false, null: false
794
    t.string "environment_scope", default: "*", null: false
795
    t.boolean "masked", default: false, null: false
796
    t.integer "variable_type", limit: 2, default: 1, null: false
797
    t.index ["project_id", "key", "environment_scope"], name: "index_ci_variables_on_project_id_and_key_and_environment_scope", unique: true, using: :btree
Douwe Maan's avatar
Douwe Maan committed
798
799
  end

Jasper Maes's avatar
Jasper Maes committed
800
  create_table "cluster_groups", id: :serial, force: :cascade do |t|
801
802
    t.integer "cluster_id", null: false
    t.integer "group_id", null: false
803
804
    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
805
806
  end

Jasper Maes's avatar
Jasper Maes committed
807
  create_table "cluster_platforms_kubernetes", id: :serial, force: :cascade do |t|
Shinya Maeda's avatar
Shinya Maeda committed
808
    t.integer "cluster_id", null: false
Kamil Trzcinski's avatar
Kamil Trzcinski committed
809
810
811
    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
812
813
814
815
816
817
818
    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"
819
    t.integer "authorization_type", limit: 2
820
    t.index ["cluster_id"], name: "index_cluster_platforms_kubernetes_on_cluster_id", unique: true, using: :btree
Shinya Maeda's avatar
Shinya Maeda committed
821
822
  end

Jasper Maes's avatar
Jasper Maes committed
823
  create_table "cluster_projects", id: :serial, force: :cascade do |t|
Shinya Maeda's avatar
Shinya Maeda committed
824
825
    t.integer "project_id", null: false
    t.integer "cluster_id", null: false
826
827
    t.datetime_with_timezone "created_at", null: false
    t.datetime_with_timezone "updated_at", null: false
828
829
    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
830
831
  end

Jasper Maes's avatar
Jasper Maes committed
832
  create_table "cluster_providers_gcp", id: :serial, force: :cascade do |t|
Shinya Maeda's avatar
Shinya Maeda committed
833
834
    t.integer "cluster_id", null: false
    t.integer "status"
Kamil Trzcinski's avatar
Kamil Trzcinski committed
835
836
837
    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
838
839
840
841
842
843
844
845
    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"
846
    t.boolean "legacy_abac", default: false, null: false
847
    t.index ["cluster_id"], name: "index_cluster_providers_gcp_on_cluster_id", unique: true, using: :btree
Shinya Maeda's avatar
Shinya Maeda committed
848
849
  end

Jasper Maes's avatar
Jasper Maes committed
850
  create_table "clusters", id: :serial, force: :cascade do |t|
851
    t.integer "user_id"
Kamil Trzcinski's avatar
Kamil Trzcinski committed
852
853
854
855
    t.integer "provider_type"
    t.integer "platform_type"
    t.datetime_with_timezone "created_at", null: false
    t.datetime_with_timezone "updated_at", null: false
856
857
    t.boolean "enabled", default: true
    t.string "name", null: false
858
    t.string "environment_scope", default: "*", null: false
859
    t.integer "cluster_type", limit: 2, default: 3, null: false
860
    t.string "domain"
861
    t.boolean "managed", default: true, null: false
862
863
    t.index ["enabled"], name: "index_clusters_on_enabled", using: :btree
    t.index ["user_id"], name: "index_clusters_on_user_id", using: :btree
Amit Rathi's avatar
Amit Rathi committed
864
865
  end

Jasper Maes's avatar
Jasper Maes committed
866
  create_table "clusters_applications_cert_managers", id: :serial, force: :cascade do |t|
867
868
869
870
871
872
873
    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"
874
    t.index ["cluster_id"], name: "index_clusters_applications_cert_managers_on_cluster_id", unique: true, using: :btree
875
876
  end

Jasper Maes's avatar
Jasper Maes committed
877
  create_table "clusters_applications_helm", id: :serial, force: :cascade do |t|
878
879
880
881
882
883
    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"
884
885
886
    t.text "encrypted_ca_key"
    t.text "encrypted_ca_key_iv"
    t.text "ca_cert"
887
    t.index ["cluster_id"], name: "index_clusters_applications_helm_on_cluster_id", unique: true, using: :btree
888
  end
889

Jasper Maes's avatar
Jasper Maes committed
890
  create_table "clusters_applications_ingress", id: :serial, force: :cascade do |t|
Kamil Trzcinski's avatar
Kamil Trzcinski committed
891
892
893
894
895
896
897
898
    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"
899
    t.string "external_ip"
900
    t.string "external_hostname"
901
    t.index ["cluster_id"], name: "index_clusters_applications_ingress_on_cluster_id", unique: true, using: :btree
Kamil Trzcinski's avatar
Kamil Trzcinski committed
902
903
  end

Jasper Maes's avatar
Jasper Maes committed
904
  create_table "clusters_applications_jupyter", id: :serial, force: :cascade do |t|
905
    t.integer "cluster_id", null: false
906
    t.integer "oauth_application_id"
907
908
909
910
911
    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
912
    t.text "status_reason"