Read about our upcoming Code of Conduct on this issue

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

14
ActiveRecord::Schema.define(version: 20180206200543) do
15

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

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

30
  create_table "appearances", force: :cascade do |t|
31
32
    t.string "title", null: false
    t.text "description", null: false
33
34
    t.string "header_logo"
    t.string "logo"
35
36
    t.datetime_with_timezone "created_at", null: false
    t.datetime_with_timezone "updated_at", null: false
37
    t.text "description_html"
38
    t.integer "cached_markdown_version"
39
40
    t.text "new_project_guidelines"
    t.text "new_project_guidelines_html"
41
42
  end

Valery Sizov's avatar
Valery Sizov committed
43
  create_table "application_settings", force: :cascade do |t|
44
45
46
47
    t.integer "default_projects_limit"
    t.boolean "signup_enabled"
    t.boolean "gravatar_enabled"
    t.text "sign_in_text"
48
49
    t.datetime "created_at"
    t.datetime "updated_at"
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
    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"
67
    t.integer "max_pages_size", default: 100, null: false
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
    t.boolean "require_two_factor_authentication", default: false
    t.integer "two_factor_grace_period", default: 48
    t.boolean "metrics_enabled", default: false
    t.string "metrics_host", default: "localhost"
    t.integer "metrics_pool_size", default: 16
    t.integer "metrics_timeout", default: 10
    t.integer "metrics_method_call_threshold", default: 10
    t.boolean "recaptcha_enabled", default: false
    t.string "recaptcha_site_key"
    t.string "recaptcha_private_key"
    t.integer "metrics_port", default: 8089
    t.boolean "akismet_enabled", default: false
    t.string "akismet_api_key"
    t.integer "metrics_sample_interval", default: 15
    t.boolean "sentry_enabled", default: false
    t.string "sentry_dsn"
    t.boolean "email_author_in_body", default: false
    t.integer "default_group_visibility"
    t.boolean "repository_checks_enabled", default: false
    t.text "shared_runners_text"
    t.integer "metrics_packet_size", default: 1
    t.text "disabled_oauth_sign_in_sources"
    t.string "health_check_access_token"
    t.boolean "send_user_confirmation_email", default: false
    t.integer "container_registry_token_expire_delay", default: 5
    t.text "after_sign_up_text"
Valery Sizov's avatar
Valery Sizov committed
94
    t.boolean "user_default_external", default: false, null: false
95
    t.string "repository_storages", default: "default"
96
97
98
    t.string "enabled_git_access_protocol"
    t.boolean "domain_blacklist_enabled", default: false
    t.text "domain_blacklist"
99
    t.boolean "usage_ping_enabled", default: true, null: false
100
101
102
103
104
105
    t.boolean "koding_enabled"
    t.string "koding_url"
    t.text "sign_in_text_html"
    t.text "help_page_text_html"
    t.text "shared_runners_text_html"
    t.text "after_sign_up_text_html"
106
107
108
109
    t.integer "rsa_key_restriction", default: 0, null: false
    t.integer "dsa_key_restriction", default: 0, null: false
    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
110
111
112
113
114
    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
115
116
117
    t.boolean "sidekiq_throttling_enabled", default: false
    t.string "sidekiq_throttling_queues"
    t.decimal "sidekiq_throttling_factor"
118
    t.boolean "html_emails_enabled", default: true
119
120
    t.string "plantuml_url"
    t.boolean "plantuml_enabled"
121
    t.integer "terminal_max_session_time", default: 0, null: false
122
123
124
    t.integer "unique_ips_limit_per_user"
    t.integer "unique_ips_limit_time_window"
    t.boolean "unique_ips_limit_enabled", default: false, null: false
125
126
    t.string "default_artifacts_expire_in", default: "0", null: false
    t.string "uuid"
127
    t.decimal "polling_interval_multiplier", default: 1.0, null: false
128
    t.integer "cached_markdown_version"
129
130
    t.boolean "clientside_sentry_enabled", default: false, null: false
    t.string "clientside_sentry_dsn"
Pawel Chojnacki's avatar
Pawel Chojnacki committed
131
    t.boolean "prometheus_metrics_enabled", default: false, null: false
132
133
    t.boolean "help_page_hide_commercial_content", default: false
    t.string "help_page_support_url"
134
    t.integer "performance_bar_allowed_group_id"
135
    t.boolean "hashed_storage_enabled", default: false, null: false
136
137
    t.boolean "project_export_enabled", default: true, null: false
    t.boolean "auto_devops_enabled", default: false, null: false
138
    t.integer "circuitbreaker_failure_count_threshold", default: 3
139
    t.integer "circuitbreaker_failure_reset_time", default: 1800
140
    t.integer "circuitbreaker_storage_timeout", default: 15
141
    t.integer "circuitbreaker_access_retries", default: 3
142
143
144
145
146
147
148
149
150
    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
151
    t.integer "circuitbreaker_check_interval", default: 1, null: false
152
153
    t.boolean "password_authentication_enabled_for_web"
    t.boolean "password_authentication_enabled_for_git", default: true
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
160
  end

Valery Sizov's avatar
Valery Sizov committed
161
  create_table "audit_events", force: :cascade do |t|
162
163
164
165
166
    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"
167
168
169
170
171
172
    t.datetime "created_at"
    t.datetime "updated_at"
  end

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

173
  create_table "award_emoji", force: :cascade do |t|
174
175
176
177
    t.string "name"
    t.integer "user_id"
    t.integer "awardable_id"
    t.string "awardable_type"
178
179
180
181
    t.datetime "created_at"
    t.datetime "updated_at"
  end

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

Douglas Barbosa Alexandre's avatar
Douglas Barbosa Alexandre committed
185
  create_table "boards", force: :cascade do |t|
186
    t.integer "project_id", null: false
Douglas Barbosa Alexandre's avatar
Douglas Barbosa Alexandre committed
187
188
189
190
191
192
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
  end

  add_index "boards", ["project_id"], name: "index_boards_on_project_id", using: :btree

Valery Sizov's avatar
Valery Sizov committed
193
  create_table "broadcast_messages", force: :cascade do |t|
194
    t.text "message", null: false
195
196
197
198
    t.datetime "starts_at", null: false
    t.datetime "ends_at", null: false
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
199
200
    t.string "color"
    t.string "font"
201
    t.text "message_html", null: false
202
    t.integer "cached_markdown_version"
203
  end
204

205
206
  add_index "broadcast_messages", ["starts_at", "ends_at", "id"], name: "index_broadcast_messages_on_starts_at_and_ends_at_and_id", using: :btree

207
208
209
  create_table "chat_names", force: :cascade do |t|
    t.integer "user_id", null: false
    t.integer "service_id", null: false
210
    t.string "team_id", null: false
211
    t.string "team_domain"
212
    t.string "chat_id", null: false
213
    t.string "chat_name"
214
    t.datetime "last_used_at"
215
216
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
217
  end
218

219
  add_index "chat_names", ["service_id", "team_id", "chat_id"], name: "index_chat_names_on_service_id_and_team_id_and_chat_id", unique: true, using: :btree
220
221
  add_index "chat_names", ["user_id", "service_id"], name: "index_chat_names_on_user_id_and_service_id", unique: true, using: :btree

222
  create_table "chat_teams", force: :cascade do |t|
223
    t.integer "namespace_id", null: false
224
225
226
227
    t.string "team_id"
    t.string "name"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
Douwe Maan's avatar
Douwe Maan committed
228
229
  end

230
  add_index "chat_teams", ["namespace_id"], name: "index_chat_teams_on_namespace_id", unique: true, using: :btree
231

232
233
234
235
236
237
238
239
  create_table "ci_build_trace_section_names", force: :cascade do |t|
    t.integer "project_id", null: false
    t.string "name", null: false
  end

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

  create_table "ci_build_trace_sections", force: :cascade do |t|
Alessio Caiazza's avatar
Alessio Caiazza committed
240
    t.integer "project_id", null: false
241
242
243
244
245
246
247
248
249
250
251
    t.datetime_with_timezone "date_start", null: false
    t.datetime_with_timezone "date_end", null: false
    t.integer "byte_start", limit: 8, null: false
    t.integer "byte_end", limit: 8, null: false
    t.integer "build_id", null: false
    t.integer "section_name_id", null: false
  end

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

Valery Sizov's avatar
Valery Sizov committed
252
  create_table "ci_builds", force: :cascade do |t|
253
    t.string "status"
Douwe Maan's avatar
Douwe Maan committed
254
    t.datetime "finished_at"
255
    t.text "trace"
Douwe Maan's avatar
Douwe Maan committed
256
257
258
    t.datetime "created_at"
    t.datetime "updated_at"
    t.datetime "started_at"
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
    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
276
    t.integer "project_id"
277
278
    t.text "artifacts_metadata"
    t.integer "erased_by_id"
279
    t.datetime "erased_at"
280
    t.datetime "artifacts_expire_at"
281
282
283
284
    t.string "environment"
    t.integer "artifacts_size", limit: 8
    t.string "when"
    t.text "yaml_variables"
285
    t.datetime "queued_at"
286
    t.string "token"
Kamil Trzcinski's avatar
Kamil Trzcinski committed
287
    t.integer "lock_version"
288
    t.string "coverage_regex"
289
    t.integer "auto_canceled_by_id"
Kamil Trzcinski's avatar
Kamil Trzcinski committed
290
    t.boolean "retried"
291
    t.integer "stage_id"
292
    t.boolean "protected"
293
    t.integer "failure_reason"
Douwe Maan's avatar
Douwe Maan committed
294
295
  end

296
  add_index "ci_builds", ["auto_canceled_by_id"], name: "index_ci_builds_on_auto_canceled_by_id", using: :btree
Kamil Trzcinski's avatar
Kamil Trzcinski committed
297
  add_index "ci_builds", ["commit_id", "stage_idx", "created_at"], name: "index_ci_builds_on_commit_id_and_stage_idx_and_created_at", using: :btree
298
  add_index "ci_builds", ["commit_id", "status", "type"], name: "index_ci_builds_on_commit_id_and_status_and_type", using: :btree
Kamil Trzcinski's avatar
Kamil Trzcinski committed
299
300
  add_index "ci_builds", ["commit_id", "type", "name", "ref"], name: "index_ci_builds_on_commit_id_and_type_and_name_and_ref", using: :btree
  add_index "ci_builds", ["commit_id", "type", "ref"], name: "index_ci_builds_on_commit_id_and_type_and_ref", using: :btree
301
  add_index "ci_builds", ["project_id", "id"], name: "index_ci_builds_on_project_id_and_id", using: :btree
302
  add_index "ci_builds", ["protected"], name: "index_ci_builds_on_protected", using: :btree
Douwe Maan's avatar
Douwe Maan committed
303
  add_index "ci_builds", ["runner_id"], name: "index_ci_builds_on_runner_id", using: :btree
304
  add_index "ci_builds", ["stage_id"], name: "index_ci_builds_on_stage_id", using: :btree
305
  add_index "ci_builds", ["status", "type", "runner_id"], name: "index_ci_builds_on_status_and_type_and_runner_id", using: :btree
306
  add_index "ci_builds", ["status"], name: "index_ci_builds_on_status", using: :btree
Kamil Trzcinski's avatar
Kamil Trzcinski committed
307
  add_index "ci_builds", ["token"], name: "index_ci_builds_on_token", unique: true, using: :btree
blackst0ne's avatar
blackst0ne committed
308
  add_index "ci_builds", ["updated_at"], name: "index_ci_builds_on_updated_at", using: :btree
blackst0ne's avatar
blackst0ne committed
309
  add_index "ci_builds", ["user_id"], name: "index_ci_builds_on_user_id", using: :btree
Douwe Maan's avatar
Douwe Maan committed
310

Shinya Maeda's avatar
fix    
Shinya Maeda committed
311
  create_table "ci_group_variables", force: :cascade do |t|
312
313
314
315
316
    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
317
318
    t.integer "group_id", null: false
    t.boolean "protected", default: false, null: false
319
320
    t.datetime_with_timezone "created_at", null: false
    t.datetime_with_timezone "updated_at", null: false
321
322
  end

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

325
326
  create_table "ci_job_artifacts", force: :cascade do |t|
    t.integer "project_id", null: false
Zeger-Jan van de Weg's avatar
Zeger-Jan van de Weg committed
327
    t.integer "job_id", null: false
328
    t.integer "file_type", null: false
329
    t.integer "size", limit: 8
330
331
    t.datetime_with_timezone "created_at", null: false
    t.datetime_with_timezone "updated_at", null: false
332
    t.datetime_with_timezone "expire_at"
333
334
335
    t.string "file"
  end

336
  add_index "ci_job_artifacts", ["job_id", "file_type"], name: "index_ci_job_artifacts_on_job_id_and_file_type", unique: true, using: :btree
337
338
  add_index "ci_job_artifacts", ["project_id"], name: "index_ci_job_artifacts_on_project_id", using: :btree

Shinya Maeda's avatar
fix    
Shinya Maeda committed
339
  create_table "ci_pipeline_schedule_variables", force: :cascade do |t|
Shinya Maeda's avatar
Shinya Maeda committed
340
341
342
343
344
    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
345
    t.integer "pipeline_schedule_id", null: false
346
347
    t.datetime_with_timezone "created_at"
    t.datetime_with_timezone "updated_at"
Shinya Maeda's avatar
Shinya Maeda committed
348
349
  end

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

352
353
354
355
356
357
358
359
360
  create_table "ci_pipeline_schedules", force: :cascade do |t|
    t.string "description"
    t.string "ref"
    t.string "cron"
    t.string "cron_timezone"
    t.datetime "next_run_at"
    t.integer "project_id"
    t.integer "owner_id"
    t.boolean "active", default: true
Douwe Maan's avatar
Douwe Maan committed
361
362
363
364
    t.datetime "created_at"
    t.datetime "updated_at"
  end

365
366
  add_index "ci_pipeline_schedules", ["next_run_at", "active"], name: "index_ci_pipeline_schedules_on_next_run_at_and_active", using: :btree
  add_index "ci_pipeline_schedules", ["project_id"], name: "index_ci_pipeline_schedules_on_project_id", using: :btree
Douwe Maan's avatar
Douwe Maan committed
367

Shinya Maeda's avatar
init    
Shinya Maeda committed
368
369
370
371
372
373
374
375
376
377
378
  create_table "ci_pipeline_variables", force: :cascade do |t|
    t.string "key", null: false
    t.text "value"
    t.text "encrypted_value"
    t.string "encrypted_value_salt"
    t.string "encrypted_value_iv"
    t.integer "pipeline_id", null: false
  end

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

Kamil Trzciński's avatar
Kamil Trzciński committed
379
  create_table "ci_pipelines", force: :cascade do |t|
380
381
382
    t.string "ref"
    t.string "sha"
    t.string "before_sha"
Douwe Maan's avatar
Douwe Maan committed
383
384
    t.datetime "created_at"
    t.datetime "updated_at"
385
386
    t.boolean "tag", default: false
    t.text "yaml_errors"
Douwe Maan's avatar
Douwe Maan committed
387
    t.datetime "committed_at"
Kamil Trzciński's avatar
Kamil Trzciński committed
388
    t.integer "project_id"
389
    t.string "status"
390
391
    t.datetime "started_at"
    t.datetime "finished_at"
392
393
    t.integer "duration"
    t.integer "user_id"
Kamil Trzcinski's avatar
Kamil Trzcinski committed
394
    t.integer "lock_version"
395
    t.integer "auto_canceled_by_id"
396
    t.integer "pipeline_schedule_id"
397
    t.integer "source"
Kamil Trzcinski's avatar
Kamil Trzcinski committed
398
    t.integer "config_source"
399
    t.boolean "protected"
400
    t.integer "failure_reason"
Douwe Maan's avatar
Douwe Maan committed
401
402
  end

403
  add_index "ci_pipelines", ["auto_canceled_by_id"], name: "index_ci_pipelines_on_auto_canceled_by_id", using: :btree
404
  add_index "ci_pipelines", ["pipeline_schedule_id"], name: "index_ci_pipelines_on_pipeline_schedule_id", using: :btree
405
  add_index "ci_pipelines", ["project_id", "ref", "status", "id"], name: "index_ci_pipelines_on_project_id_and_ref_and_status_and_id", using: :btree
Kamil Trzciński's avatar
Kamil Trzciński committed
406
407
408
409
  add_index "ci_pipelines", ["project_id", "sha"], name: "index_ci_pipelines_on_project_id_and_sha", using: :btree
  add_index "ci_pipelines", ["project_id"], name: "index_ci_pipelines_on_project_id", using: :btree
  add_index "ci_pipelines", ["status"], name: "index_ci_pipelines_on_status", using: :btree
  add_index "ci_pipelines", ["user_id"], name: "index_ci_pipelines_on_user_id", using: :btree
Douwe Maan's avatar
Douwe Maan committed
410

Valery Sizov's avatar
Valery Sizov committed
411
  create_table "ci_runner_projects", force: :cascade do |t|
412
    t.integer "runner_id", null: false
Douwe Maan's avatar
Douwe Maan committed
413
414
    t.datetime "created_at"
    t.datetime "updated_at"
Kamil Trzciński's avatar
Kamil Trzciński committed
415
    t.integer "project_id"
Douwe Maan's avatar
Douwe Maan committed
416
417
  end

Kamil Trzciński's avatar
Kamil Trzciński committed
418
  add_index "ci_runner_projects", ["project_id"], name: "index_ci_runner_projects_on_project_id", using: :btree
Douwe Maan's avatar
Douwe Maan committed
419
420
  add_index "ci_runner_projects", ["runner_id"], name: "index_ci_runner_projects_on_runner_id", using: :btree

Valery Sizov's avatar
Valery Sizov committed
421
  create_table "ci_runners", force: :cascade do |t|
422
    t.string "token"
Douwe Maan's avatar
Douwe Maan committed
423
424
    t.datetime "created_at"
    t.datetime "updated_at"
425
    t.string "description"
Douwe Maan's avatar
Douwe Maan committed
426
    t.datetime "contacted_at"
427
428
429
430
431
432
433
434
435
    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
436
    t.integer "access_level", default: 0, null: false
Douwe Maan's avatar
Douwe Maan committed
437
438
  end

439
  add_index "ci_runners", ["contacted_at"], name: "index_ci_runners_on_contacted_at", using: :btree
440
  add_index "ci_runners", ["is_shared"], name: "index_ci_runners_on_is_shared", using: :btree
441
  add_index "ci_runners", ["locked"], name: "index_ci_runners_on_locked", using: :btree
James Lopez's avatar
James Lopez committed
442
  add_index "ci_runners", ["token"], name: "index_ci_runners_on_token", using: :btree
443

444
445
446
  create_table "ci_stages", force: :cascade do |t|
    t.integer "project_id"
    t.integer "pipeline_id"
Douwe Maan's avatar
Douwe Maan committed
447
448
    t.datetime "created_at"
    t.datetime "updated_at"
449
    t.string "name"
450
    t.integer "status"
451
    t.integer "lock_version"
Douwe Maan's avatar
Douwe Maan committed
452
453
  end

454
  add_index "ci_stages", ["pipeline_id", "name"], name: "index_ci_stages_on_pipeline_id_and_name", unique: true, using: :btree
455
456
  add_index "ci_stages", ["pipeline_id"], name: "index_ci_stages_on_pipeline_id", using: :btree
  add_index "ci_stages", ["project_id"], name: "index_ci_stages_on_project_id", using: :btree
457

Valery Sizov's avatar
Valery Sizov committed
458
  create_table "ci_trigger_requests", force: :cascade do |t|
459
460
    t.integer "trigger_id", null: false
    t.text "variables"
Douwe Maan's avatar
Douwe Maan committed
461
462
    t.datetime "created_at"
    t.datetime "updated_at"
463
    t.integer "commit_id"
Douwe Maan's avatar
Douwe Maan committed
464
465
  end

466
467
  add_index "ci_trigger_requests", ["commit_id"], name: "index_ci_trigger_requests_on_commit_id", using: :btree

Valery Sizov's avatar
Valery Sizov committed
468
  create_table "ci_triggers", force: :cascade do |t|
469
    t.string "token"
Douwe Maan's avatar
Douwe Maan committed
470
471
    t.datetime "created_at"
    t.datetime "updated_at"
Kamil Trzciński's avatar
Kamil Trzciński committed
472
    t.integer "project_id"
Kamil Trzcinski's avatar
Kamil Trzcinski committed
473
474
    t.integer "owner_id"
    t.string "description"
Shinya Maeda's avatar
Shinya Maeda committed
475
    t.string "ref"
Douwe Maan's avatar
Douwe Maan committed
476
477
  end

Kamil Trzciński's avatar
Kamil Trzciński committed
478
  add_index "ci_triggers", ["project_id"], name: "index_ci_triggers_on_project_id", using: :btree
Douwe Maan's avatar
Douwe Maan committed
479

Valery Sizov's avatar
Valery Sizov committed
480
  create_table "ci_variables", force: :cascade do |t|
481
    t.string "key", null: false
482
483
484
485
    t.text "value"
    t.text "encrypted_value"
    t.string "encrypted_value_salt"
    t.string "encrypted_value_iv"
486
    t.integer "project_id", null: false
487
    t.boolean "protected", default: false, null: false
488
    t.string "environment_scope", default: "*", null: false
Douwe Maan's avatar
Douwe Maan committed
489
490
  end

491
  add_index "ci_variables", ["project_id", "key", "environment_scope"], name: "index_ci_variables_on_project_id_and_key_and_environment_scope", unique: true, using: :btree
Douwe Maan's avatar
Douwe Maan committed
492

Shinya Maeda's avatar
Shinya Maeda committed
493
494
  create_table "cluster_platforms_kubernetes", force: :cascade do |t|
    t.integer "cluster_id", null: false
Kamil Trzcinski's avatar
Kamil Trzcinski committed
495
496
497
    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
498
499
500
501
502
503
504
505
506
507
508
509
510
511
    t.text "ca_cert"
    t.string "namespace"
    t.string "username"
    t.text "encrypted_password"
    t.string "encrypted_password_iv"
    t.text "encrypted_token"
    t.string "encrypted_token_iv"
  end

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

  create_table "cluster_projects", force: :cascade do |t|
    t.integer "project_id", null: false
    t.integer "cluster_id", null: false
512
513
    t.datetime_with_timezone "created_at", null: false
    t.datetime_with_timezone "updated_at", null: false
Shinya Maeda's avatar
Shinya Maeda committed
514
515
516
517
518
519
520
521
  end

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

  create_table "cluster_providers_gcp", force: :cascade do |t|
    t.integer "cluster_id", null: false
    t.integer "status"
Kamil Trzcinski's avatar
Kamil Trzcinski committed
522
523
524
    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
525
526
527
528
529
530
531
532
533
534
535
536
537
    t.text "status_reason"
    t.string "gcp_project_id", null: false
    t.string "zone", null: false
    t.string "machine_type"
    t.string "operation_id"
    t.string "endpoint"
    t.text "encrypted_access_token"
    t.string "encrypted_access_token_iv"
  end

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

  create_table "clusters", force: :cascade do |t|
538
    t.integer "user_id"
Kamil Trzcinski's avatar
Kamil Trzcinski committed
539
540
541
542
    t.integer "provider_type"
    t.integer "platform_type"
    t.datetime_with_timezone "created_at", null: false
    t.datetime_with_timezone "updated_at", null: false
543
544
    t.boolean "enabled", default: true
    t.string "name", null: false
545
    t.string "environment_scope", default: "*", null: false
Shinya Maeda's avatar
Shinya Maeda committed
546
547
  end

Alessio Caiazza's avatar
Alessio Caiazza committed
548
549
550
  add_index "clusters", ["enabled"], name: "index_clusters_on_enabled", using: :btree
  add_index "clusters", ["user_id"], name: "index_clusters_on_user_id", using: :btree

551
552
553
554
555
556
557
558
  create_table "clusters_applications_helm", force: :cascade do |t|
    t.integer "cluster_id", null: false
    t.datetime_with_timezone "created_at", null: false
    t.datetime_with_timezone "updated_at", null: false
    t.integer "status", null: false
    t.string "version", null: false
    t.text "status_reason"
  end
559

Kamil Trzcinski's avatar
Kamil Trzcinski committed
560
561
562
563
564
565
566
567
568
569
570
  create_table "clusters_applications_ingress", force: :cascade do |t|
    t.integer "cluster_id", null: false
    t.datetime_with_timezone "created_at", null: false
    t.datetime_with_timezone "updated_at", null: false
    t.integer "status", null: false
    t.integer "ingress_type", null: false
    t.string "version", null: false
    t.string "cluster_ip"
    t.text "status_reason"
  end

571
572
573
574
575
576
577
578
579
  create_table "clusters_applications_prometheus", force: :cascade do |t|
    t.integer "cluster_id", null: false
    t.integer "status", null: false
    t.string "version", null: false
    t.text "status_reason"
    t.datetime_with_timezone "created_at", null: false
    t.datetime_with_timezone "updated_at", null: false
  end

580
  create_table "container_repositories", force: :cascade do |t|
581
582
583
584
    t.integer "project_id", null: false
    t.string "name", null: false
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
Andre Guedes's avatar
Andre Guedes committed
585
586
  end

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

590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
  create_table "conversational_development_index_metrics", force: :cascade do |t|
    t.float "leader_issues", null: false
    t.float "instance_issues", null: false
    t.float "leader_notes", null: false
    t.float "instance_notes", null: false
    t.float "leader_milestones", null: false
    t.float "instance_milestones", null: false
    t.float "leader_boards", null: false
    t.float "instance_boards", null: false
    t.float "leader_merge_requests", null: false
    t.float "instance_merge_requests", null: false
    t.float "leader_ci_pipelines", null: false
    t.float "instance_ci_pipelines", null: false
    t.float "leader_environments", null: false
    t.float "instance_environments", null: false
    t.float "leader_deployments", null: false
    t.float "instance_deployments", null: false
    t.float "leader_projects_prometheus_active", null: false
    t.float "instance_projects_prometheus_active", null: false
    t.float "leader_service_desk_issues", null: false
    t.float "instance_service_desk_issues", null: false
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
613
614
615
616
617
618
619
620
621
622
    t.float "percentage_boards", default: 0.0, null: false
    t.float "percentage_ci_pipelines", default: 0.0, null: false
    t.float "percentage_deployments", default: 0.0, null: false
    t.float "percentage_environments", default: 0.0, null: false
    t.float "percentage_issues", default: 0.0, null: false
    t.float "percentage_merge_requests", default: 0.0, null: false
    t.float "percentage_milestones", default: 0.0, null: false
    t.float "percentage_notes", default: 0.0, null: false
    t.float "percentage_projects_prometheus_active", default: 0.0, null: false
    t.float "percentage_service_desk_issues", default: 0.0, null: false
623
  end
Douwe Maan's avatar
Douwe Maan committed
624

Valery Sizov's avatar
Valery Sizov committed
625
  create_table "deploy_keys_projects", force: :cascade do |t|
626
627
    t.integer "deploy_key_id", null: false
    t.integer "project_id", null: false
628
629
    t.datetime "created_at"
    t.datetime "updated_at"
630
    t.boolean "can_push", default: false, null: false
631
  end
632

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

635
  create_table "deployments", force: :cascade do |t|
Valery Sizov's avatar
Valery Sizov committed
636
637
638
639
640
641
    t.integer "iid", null: false
    t.integer "project_id", null: false
    t.integer "environment_id", null: false
    t.string "ref", null: false
    t.boolean "tag", null: false
    t.string "sha", null: false
642
    t.integer "user_id"
Valery Sizov's avatar
Valery Sizov committed
643
644
    t.integer "deployable_id"
    t.string "deployable_type"
645
646
    t.datetime "created_at"
    t.datetime "updated_at"
Kamil Trzcinski's avatar
Kamil Trzcinski committed
647
    t.string "on_stop"
648
649
  end

650
  add_index "deployments", ["created_at"], name: "index_deployments_on_created_at", using: :btree
651
652
  add_index "deployments", ["environment_id", "id"], name: "index_deployments_on_environment_id_and_id", using: :btree
  add_index "deployments", ["environment_id", "iid", "project_id"], name: "index_deployments_on_environment_id_and_iid_and_project_id", using: :btree
653
  add_index "deployments", ["project_id", "iid"], name: "index_deployments_on_project_id_and_iid", unique: true, using: :btree
654

Valery Sizov's avatar
Valery Sizov committed
655
  create_table "emails", force: :cascade do |t|
656
657
    t.integer "user_id", null: false
    t.string "email", null: false
658
659
    t.datetime "created_at"
    t.datetime "updated_at"
660
    t.string "confirmation_token"
661
662
    t.datetime_with_timezone "confirmed_at"
    t.datetime_with_timezone "confirmation_sent_at"
663
664
  end

665
  add_index "emails", ["confirmation_token"], name: "index_emails_on_confirmation_token", unique: true, using: :btree
666
667
668
  add_index "emails", ["email"], name: "index_emails_on_email", unique: true, using: :btree
  add_index "emails", ["user_id"], name: "index_emails_on_user_id", using: :btree

669
  create_table "environments", force: :cascade do |t|
670
    t.integer "project_id", null: false
671
    t.string "name", null: false
672
673
    t.datetime "created_at"
    t.datetime "updated_at"
674
675
    t.string "external_url"
    t.string "environment_type"
676
    t.string "state", default: "available", null: false
Nick Thomas's avatar
Nick Thomas committed
677
    t.string "slug", null: false
678
679
  end

680
  add_index "environments", ["project_id", "name"], name: "index_environments_on_project_id_and_name", unique: true, using: :btree
Nick Thomas's avatar
Nick Thomas committed
681
  add_index "environments", ["project_id", "slug"], name: "index_environments_on_project_id_and_slug", unique: true, using: :btree
682

Valery Sizov's avatar
Valery Sizov committed
683
  create_table "events", force: :cascade do |t|
684
685
686
    t.integer "project_id"
    t.integer "author_id", null: false
    t.integer "target_id"
687
688
    t.datetime_with_timezone "created_at", null: false
    t.datetime_with_timezone "updated_at", null: false
689
690
691
692
    t.integer "action", limit: 2, null: false
    t.string "target_type"
  end

693
694
695
696
  add_index "events", ["action"], name: "index_events_on_action", using: :btree
  add_index "events", ["author_id"], name: "index_events_on_author_id", using: :btree
  add_index "events", ["project_id", "id"], name: "index_events_on_project_id_and_id", using: :btree
  add_index "events", ["target_type", "target_id"], name: "index_events_on_target_type_and_target_id", using: :btree
697

698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
  create_table "feature_gates", force: :cascade do |t|
    t.string "feature_key", null: false
    t.string "key", null: false
    t.string "value"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
  end

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

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

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

716
717
718
719
720
721
722
723
724
  create_table "fork_network_members", force: :cascade do |t|
    t.integer "fork_network_id", null: false
    t.integer "project_id", null: false
    t.integer "forked_from_project_id"
  end

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

725
726
727
728
729
730
731
  create_table "fork_networks", force: :cascade do |t|
    t.integer "root_project_id"
    t.string "deleted_root_project_name"
  end

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

Valery Sizov's avatar
Valery Sizov committed
732
  create_table "forked_project_links", force: :cascade do |t|
733
734
    t.integer "forked_to_project_id", null: false
    t.integer "forked_from_project_id", null: false
735
736
    t.datetime "created_at"
    t.datetime "updated_at"
737
738
  end

Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
739
  add_index "forked_project_links", ["forked_to_project_id"], name: "index_forked_project_links_on_forked_to_project_id", unique: true, using: :btree
740

741
742
  create_table "gcp_clusters", force: :cascade do |t|
    t.integer "project_id", null: false
743
    t.integer "user_id"
744
745
    t.integer "service_id"
    t.integer "status"
746
747
748
749
    t.integer "gcp_cluster_size", null: false
    t.datetime_with_timezone "created_at", null: false
    t.datetime_with_timezone "updated_at", null: false
    t.boolean "enabled", default: true
750
    t.text "status_reason"
751
752
753
    t.string "project_namespace"
    t.string "endpoint"
    t.text "ca_cert"
754
    t.text "encrypted_kubernetes_token"
755
756
    t.string "encrypted_kubernetes_token_iv"
    t.string "username"
757
    t.text "encrypted_password"
758
759
    t.string "encrypted_password_iv"
    t.string "gcp_project_id", null: false
760
761
762
    t.string "gcp_cluster_zone", null: false
    t.string "gcp_cluster_name", null: false
    t.string "gcp_machine_type"
763
    t.string "gcp_operation_id"
764
    t.text "encrypted_gcp_token"
765
766
767
768
769
    t.string "encrypted_gcp_token_iv"
  end

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

770
  create_table "gpg_key_subkeys", force: :cascade do |t|
771
    t.integer "gpg_key_id", null: false
772
773
774
775
    t.binary "keyid"
    t.binary "fingerprint"
  end

776
  add_index "gpg_key_subkeys", ["fingerprint"], name: "index_gpg_key_subkeys_on_fingerprint", unique: true, using: :btree
777
  add_index "gpg_key_subkeys", ["gpg_key_id"], name: "index_gpg_key_subkeys_on_gpg_key_id", using: :btree
778
  add_index "gpg_key_subkeys", ["keyid"], name: "index_gpg_key_subkeys_on_keyid", unique: true, using: :btree
779

Alexis Reigel's avatar
Alexis Reigel committed
780
  create_table "gpg_keys", force: :cascade do |t|
781
782
    t.datetime_with_timezone "created_at", null: false
    t.datetime_with_timezone "updated_at", null: false
783
    t.integer "user_id"
784
785
    t.binary "primary_keyid"
    t.binary "fingerprint"
786
    t.text "key"
Alexis Reigel's avatar
Alexis Reigel committed
787
788
  end

Alexis Reigel's avatar
Alexis Reigel committed
789
790
  add_index "gpg_keys", ["fingerprint"], name: "index_gpg_keys_on_fingerprint", unique: true, using: :btree
  add_index "gpg_keys", ["primary_keyid"], name: "index_gpg_keys_on_primary_keyid", unique: true, using: :btree
Alexis Reigel's avatar
Alexis Reigel committed
791
792
  add_index "gpg_keys", ["user_id"], name: "index_gpg_keys_on_user_id", using: :btree

793
  create_table "gpg_signatures", force: :cascade do |t|
794
795
    t.datetime_with_timezone "created_at", null: false
    t.datetime_with_timezone "updated_at", null: false
796
797
    t.integer "project_id"
    t.integer "gpg_key_id"
798
799
    t.binary "commit_sha"
    t.binary "gpg_key_primary_keyid"
800
801
    t.text "gpg_key_user_name"
    t.text "gpg_key_user_email"
802
    t.integer "verification_status", limit: 2, default: 0, null: false
803
    t.integer "gpg_key_subkey_id"
804
805
  end

806
  add_index "gpg_signatures", ["commit_sha"], name: "index_gpg_signatures_on_commit_sha", unique: true, using: :btree
807
808
  add_index "gpg_signatures", ["gpg_key_id"], name: "index_gpg_signatures_on_gpg_key_id", using: :btree
  add_index "gpg_signatures", ["gpg_key_primary_keyid"], name: "index_gpg_signatures_on_gpg_key_primary_keyid", using: :btree
809
  add_index "gpg_signatures", ["gpg_key_subkey_id"], name: "index_gpg_signatures_on_gpg_key_subkey_id", using: :btree
810
811
  add_index "gpg_signatures", ["project_id"], name: "index_gpg_signatures_on_project_id", using: :btree

812
813
814
815
816
817
818
819
820
821
822
  create_table "group_custom_attributes", force: :cascade do |t|
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
    t.integer "group_id", null: false
    t.string "key", null: false
    t.string "value", null: false
  end

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

Valery Sizov's avatar
Valery Sizov committed
823
  create_table "identities", force: :cascade do |t|
824
825
826
    t.string "extern_uid"
    t.string "provider"
    t.integer "user_id"
827
828
    t.datetime "created_at"
    t.datetime "updated_at"
829
830
831
832
  end

  add_index "identities", ["user_id"], name: "index_identities_on_user_id", using: :btree

833
  create_table "issue_assignees", id: false, force: :cascade do |t|
834
835
836
837
838
839
840
    t.integer "user_id", null: false
    t.integer "issue_id", null: false
  end

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

841
  create_table "issue_metrics", force: :cascade do |t|
842
    t.integer "issue_id", null: false
843
    t.datetime "first_mentioned_in_commit_at"
844
845
    t.datetime "first_associated_with_milestone_at"
    t.datetime "first_added_to_board_at"
846
847
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
848
849
850
851
  end

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

Valery Sizov's avatar
Valery Sizov committed
852
  create_table "issues", force: :cascade do |t|
853
854
855
    t.string "title"
    t.integer "author_id"
    t.integer "project_id"
856
857
    t.datetime "created_at"
    t.datetime "updated_at"
858
859
860
861
862
    t.text "description"
    t.integer "milestone_id"
    t.string "state"
    t.integer "iid"
    t.integer "updated_by_id"
863
    t.boolean "confidential", default: false, null: false
864
865
866
867
868
    t.date "due_date"
    t.integer "moved_to_id"
    t.integer "lock_version"
    t.text "title_html"
    t.text "description_html"
869
    t.integer "time_estimate"
870
    t.integer "relative_position"
871
    t.integer "cached_markdown_version"
872
873
    t.datetime "last_edited_at"
    t.integer "last_edited_by_id"
874
    t.boolean "discussion_locked"
875
    t.datetime_with_timezone "closed_at"
Andrew8xx8's avatar
Andrew8xx8 committed
876
877
  end

Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
878
  add_index "issues", ["author_id"], name: "index_issues_on_author_id", using: :btree
879
  add_index "issues", ["confidential"], name: "index_issues_on_confidential", using: :btree
880
  add_index "issues", ["description"], name: "index_issues_on_description_trigram", using: :gin, opclasses: {"description"=>"gin_trgm_ops"}
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
881
  add_index "issues", ["milestone_id"], name: "index_issues_on_milestone_id", using: :btree
882
  add_index "issues", ["moved_to_id"], name: "index_issues_on_moved_to_id", where: "(moved_to_id IS NOT NULL)", using: :btree
883
  add_index "issues", ["project_id", "created_at", "id", "state"], name: "index_issues_on_project_id_and_created_at_and_id_and_state", using: :btree
884
  add_index "issues", ["project_id", "due_date", "id", "state"], name: "idx_issues_on_project_id_and_due_date_and_id_and_state_partial", where: "(due_date IS NOT NULL)", using: :btree
885
  add_index "issues", ["project_id", "iid"], name: "index_issues_on_project_id_and_iid", unique: true, using: :btree
886
  add_index "issues", ["project_id", "updated_at", "id", "state"], name: "index_issues_on_project_id_and_updated_at_and_id_and_state", using: :btree
887
  add_index "issues", ["relative_position"], name: "index_issues_on_relative_position", using: :btree
888
  add_index "issues", ["state"], name: "index_issues_on_state", using: :btree
889
  add_index "issues", ["title"], name: "index_issues_on_title_trigram", using: :gin, opclasses: {"title"=>"gin_trgm_ops"}
890
  add_index "issues", ["updated_at"], name: "index_issues_on_updated_at", using: :btree
891
  add_index "issues", ["updated_by_id"], name: "index_issues_on_updated_by_id", where: "(updated_by_id IS NOT NULL)", using: :btree
Andrew8xx8's avatar
Andrew8xx8 committed
892

Valery Sizov's avatar
Valery Sizov committed
893
  create_table "keys", force: :cascade do |t|
894
    t.integer "user_id"
895
896
    t.datetime "created_at"
    t.datetime "updated_at"
897
898
899
900
901
    t.text "key"
    t.string "title"
    t.string "type"
    t.string "fingerprint"
    t.boolean "public", default: false, null: false
902
    t.datetime "last_used_at"
Andrew8xx8's avatar
Andrew8xx8 committed
903
904
  end

905
  add_index "keys", ["fingerprint"], name: "index_keys_on_fingerprint", unique: true, using: :btree
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
906
  add_index "keys", ["user_id"], name: "index_keys_on_user_id", using: :btree
Andrew8xx8's avatar
Andrew8xx8 committed
907

Valery Sizov's avatar
Valery Sizov committed
908
  create_table "label_links", force: :cascade do |t|
909
910
911
    t.integer "label_id"
    t.integer "target_id"
    t.string "target_type"
912
913
914
915
    t.datetime "created_at"
    t.datetime "updated_at"
  end

Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
916
917
918
  add_index "label_links", ["label_id"], name: "index_label_links_on_label_id", using: :btree
  add_index "label_links", ["target_id", "target_type"], name: "index_label_links_on_target_id_and_target_type", using: :btree

919
920
921
922
923
924
925
926
927
928
929
  create_table "label_priorities", force: :cascade do |t|
    t.integer "project_id", null: false
    t.integer "label_id", null: false
    t.integer "priority", null: false
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
  end

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

Valery Sizov's avatar
Valery Sizov committed
930
  create_table "labels", force: :cascade do |t|
931
932
933
    t.string "title"
    t.string "color"
    t.integer "project_id"
934
935
    t.datetime "created_at"
    t.datetime "updated_at"
936
937
938
    t.boolean "template", default: false
    t.string "description"
    t.text "description_html"
939
940
    t.string "type"
    t.integer "group_id"
941
    t.integer "cached_markdown_version"
942
943
  end

944
  add_index "labels", ["group_id", "project_id", "title"], name: "index_labels_on_group_id_and_project_id_and_title", unique: true, using: :btree
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
945
  add_index "labels", ["project_id"], name: "index_labels_on_project_id", using: :btree
946
  add_index "labels", ["template"], name: "index_labels_on_template", where: "template", using: :btree
Ahmad Sherif's avatar
Ahmad Sherif committed
947
  add_index "labels", ["title"], name: "index_labels_on_title", using: :btree
948
  add_index "labels", ["type", "project_id"], name: "index_labels_on_type_and_project_id", using: :btree
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
949

950
951
952
953
954
955
956
957
958
959
  create_table "lfs_file_locks", force: :cascade do |t|
    t.integer "project_id", null: false
    t.integer "user_id", null: false
    t.datetime "created_at", null: false
    t.string "path", limit: 511
  end

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

Valery Sizov's avatar
Valery Sizov committed
960
  create_table "lfs_objects", force: :cascade do |t|
961
962
    t.string "oid", null: false