Read about our upcoming Code of Conduct on this issue

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

Grzegorz Bizon's avatar
Grzegorz Bizon committed
14
ActiveRecord::Schema.define(version: 20170703102400) 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
33
34
35
36
37
    t.string "title"
    t.text "description"
    t.string "header_logo"
    t.string "logo"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
    t.text "description_html"
38
    t.integer "cached_markdown_version"
39
40
  end

Valery Sizov's avatar
Valery Sizov committed
41
  create_table "application_settings", force: :cascade do |t|
42
43
44
45
46
    t.integer "default_projects_limit"
    t.boolean "signup_enabled"
    t.boolean "signin_enabled"
    t.boolean "gravatar_enabled"
    t.text "sign_in_text"
47
48
    t.datetime "created_at"
    t.datetime "updated_at"
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
    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"
66
    t.integer "max_pages_size", default: 100, null: false
67
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
    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
93
    t.boolean "user_default_external", default: false, null: false
94
    t.string "repository_storages", default: "default"
95
96
97
    t.string "enabled_git_access_protocol"
    t.boolean "domain_blacklist_enabled", default: false
    t.text "domain_blacklist"
98
    t.boolean "usage_ping_enabled", default: true, null: false
99
100
101
102
103
104
    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"
Jacob Vosmaer's avatar
Jacob Vosmaer committed
105
106
107
108
109
    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
110
111
112
    t.boolean "sidekiq_throttling_enabled", default: false
    t.string "sidekiq_throttling_queues"
    t.decimal "sidekiq_throttling_factor"
113
    t.boolean "html_emails_enabled", default: true
114
115
    t.string "plantuml_url"
    t.boolean "plantuml_enabled"
116
    t.integer "terminal_max_session_time", default: 0, null: false
117
118
119
    t.integer "unique_ips_limit_per_user"
    t.integer "unique_ips_limit_time_window"
    t.boolean "unique_ips_limit_enabled", default: false, null: false
120
121
    t.string "default_artifacts_expire_in", default: "0", null: false
    t.string "uuid"
122
    t.decimal "polling_interval_multiplier", default: 1.0, null: false
123
    t.integer "cached_markdown_version"
124
125
    t.boolean "clientside_sentry_enabled", default: false, null: false
    t.string "clientside_sentry_dsn"
Pawel Chojnacki's avatar
Pawel Chojnacki committed
126
    t.boolean "prometheus_metrics_enabled", default: false, null: false
127
128
    t.boolean "help_page_hide_commercial_content", default: false
    t.string "help_page_support_url"
129
130
  end

Valery Sizov's avatar
Valery Sizov committed
131
  create_table "audit_events", force: :cascade do |t|
132
133
134
135
136
    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"
137
138
139
140
141
142
    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

143
  create_table "award_emoji", force: :cascade do |t|
144
145
146
147
    t.string "name"
    t.integer "user_id"
    t.integer "awardable_id"
    t.string "awardable_type"
148
149
150
151
    t.datetime "created_at"
    t.datetime "updated_at"
  end

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

Douglas Barbosa Alexandre's avatar
Douglas Barbosa Alexandre committed
155
  create_table "boards", force: :cascade do |t|
156
    t.integer "project_id", null: false
Douglas Barbosa Alexandre's avatar
Douglas Barbosa Alexandre committed
157
158
159
160
161
162
    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
163
  create_table "broadcast_messages", force: :cascade do |t|
164
    t.text "message", null: false
165
166
    t.datetime "starts_at"
    t.datetime "ends_at"
167
168
    t.datetime "created_at"
    t.datetime "updated_at"
169
170
171
    t.string "color"
    t.string "font"
    t.text "message_html"
172
    t.integer "cached_markdown_version"
173
  end
174

175
176
177
  create_table "chat_names", force: :cascade do |t|
    t.integer "user_id", null: false
    t.integer "service_id", null: false
178
    t.string "team_id", null: false
179
    t.string "team_domain"
180
    t.string "chat_id", null: false
181
    t.string "chat_name"
182
    t.datetime "last_used_at"
183
184
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
185
  end
186

187
  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
188
189
  add_index "chat_names", ["user_id", "service_id"], name: "index_chat_names_on_user_id_and_service_id", unique: true, using: :btree

190
  create_table "chat_teams", force: :cascade do |t|
191
    t.integer "namespace_id", null: false
192
193
194
195
    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
196
197
  end

198
  add_index "chat_teams", ["namespace_id"], name: "index_chat_teams_on_namespace_id", unique: true, using: :btree
199

Valery Sizov's avatar
Valery Sizov committed
200
  create_table "ci_builds", force: :cascade do |t|
201
    t.string "status"
Douwe Maan's avatar
Douwe Maan committed
202
    t.datetime "finished_at"
203
    t.text "trace"
Douwe Maan's avatar
Douwe Maan committed
204
205
206
    t.datetime "created_at"
    t.datetime "updated_at"
    t.datetime "started_at"
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
    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
224
    t.integer "project_id"
225
226
    t.text "artifacts_metadata"
    t.integer "erased_by_id"
227
    t.datetime "erased_at"
228
    t.datetime "artifacts_expire_at"
229
230
231
232
    t.string "environment"
    t.integer "artifacts_size", limit: 8
    t.string "when"
    t.text "yaml_variables"
233
    t.datetime "queued_at"
234
    t.string "token"
Kamil Trzcinski's avatar
Kamil Trzcinski committed
235
    t.integer "lock_version"
236
    t.string "coverage_regex"
237
    t.integer "auto_canceled_by_id"
Kamil Trzcinski's avatar
Kamil Trzcinski committed
238
    t.boolean "retried"
239
    t.integer "stage_id"
Douwe Maan's avatar
Douwe Maan committed
240
241
  end

242
  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
243
  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
244
  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
245
246
  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
Douwe Maan's avatar
Douwe Maan committed
247
248
  add_index "ci_builds", ["project_id"], name: "index_ci_builds_on_project_id", using: :btree
  add_index "ci_builds", ["runner_id"], name: "index_ci_builds_on_runner_id", using: :btree
249
  add_index "ci_builds", ["stage_id"], name: "index_ci_builds_on_stage_id", using: :btree
250
  add_index "ci_builds", ["status", "type", "runner_id"], name: "index_ci_builds_on_status_and_type_and_runner_id", using: :btree
251
  add_index "ci_builds", ["status"], name: "index_ci_builds_on_status", using: :btree
Kamil Trzcinski's avatar
Kamil Trzcinski committed
252
  add_index "ci_builds", ["token"], name: "index_ci_builds_on_token", unique: true, using: :btree
blackst0ne's avatar
blackst0ne committed
253
  add_index "ci_builds", ["updated_at"], name: "index_ci_builds_on_updated_at", using: :btree
blackst0ne's avatar
blackst0ne committed
254
  add_index "ci_builds", ["user_id"], name: "index_ci_builds_on_user_id", using: :btree
Douwe Maan's avatar
Douwe Maan committed
255

256
257
258
259
260
261
262
263
264
265
  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
    t.datetime "deleted_at"
Douwe Maan's avatar
Douwe Maan committed
266
267
268
269
    t.datetime "created_at"
    t.datetime "updated_at"
  end

270
271
  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
272

Kamil Trzciński's avatar
Kamil Trzciński committed
273
  create_table "ci_pipelines", force: :cascade do |t|
274
275
276
    t.string "ref"
    t.string "sha"
    t.string "before_sha"
Douwe Maan's avatar
Douwe Maan committed
277
278
    t.datetime "created_at"
    t.datetime "updated_at"
279
280
    t.boolean "tag", default: false
    t.text "yaml_errors"
Douwe Maan's avatar
Douwe Maan committed
281
    t.datetime "committed_at"
Kamil Trzciński's avatar
Kamil Trzciński committed
282
    t.integer "project_id"
283
    t.string "status"
284
285
    t.datetime "started_at"
    t.datetime "finished_at"
286
287
    t.integer "duration"
    t.integer "user_id"
Kamil Trzcinski's avatar
Kamil Trzcinski committed
288
    t.integer "lock_version"
289
    t.integer "auto_canceled_by_id"
290
    t.integer "pipeline_schedule_id"
291
    t.integer "source"
Douwe Maan's avatar
Douwe Maan committed
292
293
  end

294
  add_index "ci_pipelines", ["auto_canceled_by_id"], name: "index_ci_pipelines_on_auto_canceled_by_id", using: :btree
295
  add_index "ci_pipelines", ["pipeline_schedule_id"], name: "index_ci_pipelines_on_pipeline_schedule_id", using: :btree
Kamil Trzciński's avatar
Kamil Trzciński committed
296
297
298
299
300
  add_index "ci_pipelines", ["project_id", "ref", "status"], name: "index_ci_pipelines_on_project_id_and_ref_and_status", using: :btree
  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
301

Valery Sizov's avatar
Valery Sizov committed
302
  create_table "ci_runner_projects", force: :cascade do |t|
303
    t.integer "runner_id", null: false
Douwe Maan's avatar
Douwe Maan committed
304
305
    t.datetime "created_at"
    t.datetime "updated_at"
Kamil Trzciński's avatar
Kamil Trzciński committed
306
    t.integer "project_id"
Douwe Maan's avatar
Douwe Maan committed
307
308
  end

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

Valery Sizov's avatar
Valery Sizov committed
312
  create_table "ci_runners", force: :cascade do |t|
313
    t.string "token"
Douwe Maan's avatar
Douwe Maan committed
314
315
    t.datetime "created_at"
    t.datetime "updated_at"
316
    t.string "description"
Douwe Maan's avatar
Douwe Maan committed
317
    t.datetime "contacted_at"
318
319
320
321
322
323
324
325
326
    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
Douwe Maan's avatar
Douwe Maan committed
327
328
  end

329
  add_index "ci_runners", ["contacted_at"], name: "index_ci_runners_on_contacted_at", using: :btree
330
  add_index "ci_runners", ["is_shared"], name: "index_ci_runners_on_is_shared", using: :btree
331
  add_index "ci_runners", ["locked"], name: "index_ci_runners_on_locked", using: :btree
James Lopez's avatar
James Lopez committed
332
  add_index "ci_runners", ["token"], name: "index_ci_runners_on_token", using: :btree
333

334
335
336
  create_table "ci_stages", force: :cascade do |t|
    t.integer "project_id"
    t.integer "pipeline_id"
Douwe Maan's avatar
Douwe Maan committed
337
338
    t.datetime "created_at"
    t.datetime "updated_at"
339
    t.string "name"
Douwe Maan's avatar
Douwe Maan committed
340
341
  end

342
  add_index "ci_stages", ["pipeline_id", "name"], name: "index_ci_stages_on_pipeline_id_and_name", using: :btree
343
344
  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
345

Valery Sizov's avatar
Valery Sizov committed
346
  create_table "ci_trigger_requests", force: :cascade do |t|
347
348
    t.integer "trigger_id", null: false
    t.text "variables"
Douwe Maan's avatar
Douwe Maan committed
349
350
    t.datetime "created_at"
    t.datetime "updated_at"
351
    t.integer "commit_id"
Douwe Maan's avatar
Douwe Maan committed
352
353
  end

354
355
  add_index "ci_trigger_requests", ["commit_id"], name: "index_ci_trigger_requests_on_commit_id", using: :btree

Valery Sizov's avatar
Valery Sizov committed
356
  create_table "ci_triggers", force: :cascade do |t|
357
    t.string "token"
Douwe Maan's avatar
Douwe Maan committed
358
359
360
    t.datetime "deleted_at"
    t.datetime "created_at"
    t.datetime "updated_at"
Kamil Trzciński's avatar
Kamil Trzciński committed
361
    t.integer "project_id"
Kamil Trzcinski's avatar
Kamil Trzcinski committed
362
363
    t.integer "owner_id"
    t.string "description"
Shinya Maeda's avatar
Shinya Maeda committed
364
    t.string "ref"
Douwe Maan's avatar
Douwe Maan committed
365
366
  end

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

Valery Sizov's avatar
Valery Sizov committed
369
  create_table "ci_variables", force: :cascade do |t|
370
    t.string "key", null: false
371
372
373
374
    t.text "value"
    t.text "encrypted_value"
    t.string "encrypted_value_salt"
    t.string "encrypted_value_iv"
375
    t.integer "project_id", null: false
376
    t.boolean "protected", default: false, null: false
377
    t.string "environment_scope", default: "*", null: false
Douwe Maan's avatar
Douwe Maan committed
378
379
  end

380
  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
381

382
  create_table "container_repositories", force: :cascade do |t|
383
384
385
386
    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
387
388
  end

389
390
391
  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

392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
  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
  end
Douwe Maan's avatar
Douwe Maan committed
416

Valery Sizov's avatar
Valery Sizov committed
417
  create_table "deploy_keys_projects", force: :cascade do |t|
418
419
    t.integer "deploy_key_id", null: false
    t.integer "project_id", null: false
420
421
    t.datetime "created_at"
    t.datetime "updated_at"
422
  end
423

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

426
  create_table "deployments", force: :cascade do |t|
Valery Sizov's avatar
Valery Sizov committed
427
428
429
430
431
432
    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
433
    t.integer "user_id"
Valery Sizov's avatar
Valery Sizov committed
434
435
    t.integer "deployable_id"
    t.string "deployable_type"
436
437
    t.datetime "created_at"
    t.datetime "updated_at"
Kamil Trzcinski's avatar
Kamil Trzcinski committed
438
    t.string "on_stop"
439
440
  end

441
  add_index "deployments", ["created_at"], name: "index_deployments_on_created_at", using: :btree
442
  add_index "deployments", ["project_id", "environment_id", "iid"], name: "index_deployments_on_project_id_and_environment_id_and_iid", using: :btree
443
  add_index "deployments", ["project_id", "iid"], name: "index_deployments_on_project_id_and_iid", unique: true, using: :btree
444

Valery Sizov's avatar
Valery Sizov committed
445
  create_table "emails", force: :cascade do |t|
446
447
    t.integer "user_id", null: false
    t.string "email", null: false
448
449
450
451
452
453
454
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  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

455
  create_table "environments", force: :cascade do |t|
456
457
    t.integer "project_id"
    t.string "name", null: false
458
459
    t.datetime "created_at"
    t.datetime "updated_at"
460
461
    t.string "external_url"
    t.string "environment_type"
462
    t.string "state", default: "available", null: false
Nick Thomas's avatar
Nick Thomas committed
463
    t.string "slug", null: false
464
465
  end

466
  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
467
  add_index "environments", ["project_id", "slug"], name: "index_environments_on_project_id_and_slug", unique: true, using: :btree
468

Valery Sizov's avatar
Valery Sizov committed
469
  create_table "events", force: :cascade do |t|
470
471
472
473
474
    t.string "target_type"
    t.integer "target_id"
    t.string "title"
    t.text "data"
    t.integer "project_id"
475
476
    t.datetime "created_at"
    t.datetime "updated_at"
477
478
    t.integer "action"
    t.integer "author_id"
Andrew8xx8's avatar
Andrew8xx8 committed
479
480
  end

Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
481
482
483
484
485
486
487
  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", ["created_at"], name: "index_events_on_created_at", using: :btree
  add_index "events", ["project_id"], name: "index_events_on_project_id", using: :btree
  add_index "events", ["target_id"], name: "index_events_on_target_id", using: :btree
  add_index "events", ["target_type"], name: "index_events_on_target_type", using: :btree

488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
  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

Valery Sizov's avatar
Valery Sizov committed
506
  create_table "forked_project_links", force: :cascade do |t|
507
508
    t.integer "forked_to_project_id", null: false
    t.integer "forked_from_project_id", null: false
509
510
    t.datetime "created_at"
    t.datetime "updated_at"
511
512
  end

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

Valery Sizov's avatar
Valery Sizov committed
515
  create_table "identities", force: :cascade do |t|
516
517
518
    t.string "extern_uid"
    t.string "provider"
    t.integer "user_id"
519
520
    t.datetime "created_at"
    t.datetime "updated_at"
521
522
523
524
  end

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

525
  create_table "issue_assignees", id: false, force: :cascade do |t|
526
527
528
529
530
531
532
    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

533
  create_table "issue_metrics", force: :cascade do |t|
534
    t.integer "issue_id", null: false
535
    t.datetime "first_mentioned_in_commit_at"
536
537
    t.datetime "first_associated_with_milestone_at"
    t.datetime "first_added_to_board_at"
538
539
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
540
541
542
543
  end

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

Valery Sizov's avatar
Valery Sizov committed
544
  create_table "issues", force: :cascade do |t|
545
546
547
548
    t.string "title"
    t.integer "assignee_id"
    t.integer "author_id"
    t.integer "project_id"
549
550
    t.datetime "created_at"
    t.datetime "updated_at"
551
552
553
554
555
556
557
    t.string "branch_name"
    t.text "description"
    t.integer "milestone_id"
    t.string "state"
    t.integer "iid"
    t.integer "updated_by_id"
    t.boolean "confidential", default: false
558
    t.datetime "deleted_at"
559
560
561
562
563
    t.date "due_date"
    t.integer "moved_to_id"
    t.integer "lock_version"
    t.text "title_html"
    t.text "description_html"
564
    t.integer "time_estimate"
565
    t.integer "relative_position"
Felipe Artur's avatar
Felipe Artur committed
566
    t.datetime "closed_at"
567
    t.integer "cached_markdown_version"
568
569
    t.datetime "last_edited_at"
    t.integer "last_edited_by_id"
Andrew8xx8's avatar
Andrew8xx8 committed
570
571
  end

Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
572
573
  add_index "issues", ["assignee_id"], name: "index_issues_on_assignee_id", using: :btree
  add_index "issues", ["author_id"], name: "index_issues_on_author_id", using: :btree
574
  add_index "issues", ["confidential"], name: "index_issues_on_confidential", using: :btree
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
575
  add_index "issues", ["created_at"], name: "index_issues_on_created_at", using: :btree
Zeger-Jan van de Weg's avatar
Zeger-Jan van de Weg committed
576
  add_index "issues", ["deleted_at"], name: "index_issues_on_deleted_at", using: :btree
577
  add_index "issues", ["description"], name: "index_issues_on_description_trigram", using: :gin, opclasses: {"description"=>"gin_trgm_ops"}
578
  add_index "issues", ["due_date"], name: "index_issues_on_due_date", using: :btree
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
579
  add_index "issues", ["milestone_id"], name: "index_issues_on_milestone_id", using: :btree
580
  add_index "issues", ["project_id", "iid"], name: "index_issues_on_project_id_and_iid", unique: true, using: :btree
581
  add_index "issues", ["relative_position"], name: "index_issues_on_relative_position", using: :btree
582
  add_index "issues", ["state"], name: "index_issues_on_state", using: :btree
583
  add_index "issues", ["title"], name: "index_issues_on_title_trigram", using: :gin, opclasses: {"title"=>"gin_trgm_ops"}
Andrew8xx8's avatar
Andrew8xx8 committed
584

Valery Sizov's avatar
Valery Sizov committed
585
  create_table "keys", force: :cascade do |t|
586
    t.integer "user_id"
587
588
    t.datetime "created_at"
    t.datetime "updated_at"
589
590
591
592
593
    t.text "key"
    t.string "title"
    t.string "type"
    t.string "fingerprint"
    t.boolean "public", default: false, null: false
594
    t.boolean "can_push", default: false, null: false
595
    t.datetime "last_used_at"
Andrew8xx8's avatar
Andrew8xx8 committed
596
597
  end

598
  add_index "keys", ["fingerprint"], name: "index_keys_on_fingerprint", unique: true, using: :btree
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
599
  add_index "keys", ["user_id"], name: "index_keys_on_user_id", using: :btree
Andrew8xx8's avatar
Andrew8xx8 committed
600

Valery Sizov's avatar
Valery Sizov committed
601
  create_table "label_links", force: :cascade do |t|
602
603
604
    t.integer "label_id"
    t.integer "target_id"
    t.string "target_type"
605
606
607
608
    t.datetime "created_at"
    t.datetime "updated_at"
  end

Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
609
610
611
  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

612
613
614
615
616
617
618
619
620
621
622
  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
623
  create_table "labels", force: :cascade do |t|
624
625
626
    t.string "title"
    t.string "color"
    t.integer "project_id"
627
628
    t.datetime "created_at"
    t.datetime "updated_at"
629
630
631
    t.boolean "template", default: false
    t.string "description"
    t.text "description_html"
632
633
    t.string "type"
    t.integer "group_id"
634
    t.integer "cached_markdown_version"
635
636
  end

637
  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
638
  add_index "labels", ["project_id"], name: "index_labels_on_project_id", using: :btree
Ahmad Sherif's avatar
Ahmad Sherif committed
639
  add_index "labels", ["title"], name: "index_labels_on_title", using: :btree
640
  add_index "labels", ["type", "project_id"], name: "index_labels_on_type_and_project_id", using: :btree
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
641

Valery Sizov's avatar
Valery Sizov committed
642
  create_table "lfs_objects", force: :cascade do |t|
643
644
    t.string "oid", null: false
    t.integer "size", limit: 8, null: false
Marin Jankovski's avatar
Marin Jankovski committed
645
646
    t.datetime "created_at"
    t.datetime "updated_at"
647
    t.string "file"
Marin Jankovski's avatar
Marin Jankovski committed
648
649
  end

650
  add_index "lfs_objects", ["oid"], name: "index_lfs_objects_on_oid", unique: true, using: :btree
Marin Jankovski's avatar
Marin Jankovski committed
651

Valery Sizov's avatar
Valery Sizov committed
652
  create_table "lfs_objects_projects", force: :cascade do |t|
653
654
    t.integer "lfs_object_id", null: false
    t.integer "project_id", null: false
Marin Jankovski's avatar
Marin Jankovski committed
655
656
657
658
659
660
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "lfs_objects_projects", ["project_id"], name: "index_lfs_objects_projects_on_project_id", using: :btree

Douglas Barbosa Alexandre's avatar
Douglas Barbosa Alexandre committed
661
  create_table "lists", force: :cascade do |t|
662
663
664
665
666
667
    t.integer "board_id", null: false
    t.integer "label_id"
    t.integer "list_type", default: 1, null: false
    t.integer "position"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
Douglas Barbosa Alexandre's avatar
Douglas Barbosa Alexandre committed
668
669
  end

670
  add_index "lists", ["board_id", "label_id"], name: "index_lists_on_board_id_and_label_id", unique: true, using: :btree
Douglas Barbosa Alexandre's avatar
Douglas Barbosa Alexandre committed
671
672
  add_index "lists", ["label_id"], name: "index_lists_on_label_id", using: :btree

Valery Sizov's avatar
Valery Sizov committed
673
  create_table "members", force: :cascade do |t|
674
675
676
677
678
679
    t.integer "access_level", null: false
    t.integer "source_id", null: false
    t.string "source_type", null: false
    t.integer "user_id"
    t.integer "notification_level", null: false
    t.string "type"
680
681
    t.datetime "created_at"
    t.datetime "updated_at"
682
683
684
    t.integer "created_by_id"
    t.string "invite_email"
    t.string "invite_token"
Douwe Maan's avatar
Douwe Maan committed
685
    t.datetime "invite_accepted_at"
Rémy Coutable's avatar
Rémy Coutable committed
686
    t.datetime "requested_at"
687
    t.date "expires_at"
688
689
  end

690
  add_index "members", ["access_level"], name: "index_members_on_access_level", using: :btree
Douwe Maan's avatar
Douwe Maan committed
691
  add_index "members", ["invite_token"], name: "index_members_on_invite_token", unique: true, using: :btree
692
  add_index "members", ["requested_at"], name: "index_members_on_requested_at", using: :btree
693
694
695
  add_index "members", ["source_id", "source_type"], name: "index_members_on_source_id_and_source_type", using: :btree
  add_index "members", ["user_id"], name: "index_members_on_user_id", using: :btree

696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
  create_table "merge_request_diff_files", id: false, force: :cascade do |t|
    t.integer "merge_request_diff_id", null: false
    t.integer "relative_order", null: false
    t.boolean "new_file", null: false
    t.boolean "renamed_file", null: false
    t.boolean "deleted_file", null: false
    t.boolean "too_large", null: false
    t.string "a_mode", null: false
    t.string "b_mode", null: false
    t.text "new_path", null: false
    t.text "old_path", null: false
    t.text "diff", null: false
  end

  add_index "merge_request_diff_files", ["merge_request_diff_id", "relative_order"], name: "index_merge_request_diff_files_on_mr_diff_id_and_order", unique: true, using: :btree

Valery Sizov's avatar
Valery Sizov committed
712
  create_table "merge_request_diffs", force: :cascade do |t|
713
714
715
716
    t.string "state"
    t.text "st_commits"
    t.text "st_diffs"
    t.integer "merge_request_id", null: false
717
718
    t.datetime "created_at"
    t.datetime "updated_at"
719
720
721
722
    t.string "base_commit_sha"
    t.string "real_size"
    t.string "head_commit_sha"
    t.string "start_commit_sha"
723
724
  end

725
  add_index "merge_request_diffs", ["merge_request_id"], name: "index_merge_request_diffs_on_merge_request_id", using: :btree
726

727
  create_table "merge_request_metrics", force: :cascade do |t|
728
    t.integer "merge_request_id", null: false
729
730
    t.datetime "latest_build_started_at"
    t.datetime "latest_build_finished_at"
Timothy Andrew's avatar
Timothy Andrew committed
731
732
    t.datetime "first_deployed_to_production_at"
    t.datetime "merged_at"
733
734
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
735
    t.integer "pipeline_id"
736
737
  end

738
  add_index "merge_request_metrics", ["first_deployed_to_production_at"], name: "index_merge_request_metrics_on_first_deployed_to_production_at", using: :btree
739
  add_index "merge_request_metrics", ["merge_request_id"], name: "index_merge_request_metrics", using: :btree
740
  add_index "merge_request_metrics", ["pipeline_id"], name: "index_merge_request_metrics_on_pipeline_id", using: :btree
741

Valery Sizov's avatar
Valery Sizov committed
742
  create_table "merge_requests", force: :cascade do |t|
743
744
745
746
747
748
    t.string "target_branch", null: false
    t.string "source_branch", null: false
    t.integer "source_project_id", null: false
    t.integer "author_id"
    t.integer "assignee_id"
    t.string "title"
749
750
    t.datetime "created_at"
    t.datetime "updated_at"
751
752
753
754
755
756
    t.integer "milestone_id"
    t.string "state"
    t.string "merge_status"
    t.integer "target_project_id", null: false
    t.integer "iid"
    t.text "description"
757
    t.datetime "locked_at"
758
759
760
    t.integer "updated_by_id"
    t.text "merge_error"
    t.text "merge_params"
761
    t.boolean "merge_when_pipeline_succeeds", default: false, null: false
762
763
    t.integer "merge_user_id"
    t.string "merge_commit_sha"
Zeger-Jan van de Weg's avatar
Zeger-Jan van de Weg committed
764
    t.datetime "deleted_at"
765
    t.string "in_progress_merge_commit_sha"
Valery Sizov's avatar
Valery Sizov committed
766
    t.integer "lock_version"
767
768
    t.text "title_html"
    t.text "description_html"
769
    t.integer "time_estimate"
770
    t.integer "cached_markdown_version"
771
772
    t.datetime "last_edited_at"
    t.integer "last_edited_by_id"
773
    t.integer "head_pipeline_id"
774
    t.boolean "ref_fetched"
Andrew8xx8's avatar
Andrew8xx8 committed
775
  end
tiagonbotelho's avatar
tiagonbotelho committed
776

Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
777
778
779
  add_index "merge_requests", ["assignee_id"], name: "index_merge_requests_on_assignee_id", using: :btree
  add_index "merge_requests", ["author_id"], name: "index_merge_requests_on_author_id", using: :btree
  add_index "merge_requests", ["created_at"], name: "index_merge_requests_on_created_at", using: :btree
Zeger-Jan van de Weg's avatar
Zeger-Jan van de Weg committed
780
  add_index "merge_requests", ["deleted_at"], name: "index_merge_requests_on_deleted_at", using: :btree
781
  add_index "merge_requests", ["description"], name: "index_merge_requests_on_description_trigram", using: :gin, opclasses: {"description"=>"gin_trgm_ops"}
782
  add_index "merge_requests", ["head_pipeline_id"], name: "index_merge_requests_on_head_pipeline_id", using: :btree
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
783
784
  add_index "merge_requests", ["milestone_id"], name: "index_merge_requests_on_milestone_id", using: :btree
  add_index "merge_requests", ["source_branch"], name: "index_merge_requests_on_source_branch", using: :btree
785
  add_index "merge_requests", ["source_project_id"], name: "index_merge_requests_on_source_project_id", using: :btree
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
786
  add_index "merge_requests", ["target_branch"], name: "index_merge_requests_on_target_branch", using: :btree
787
  add_index "merge_requests", ["target_project_id", "iid"], name: "index_merge_requests_on_target_project_id_and_iid", unique: true, using: :btree
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
788
  add_index "merge_requests", ["title"], name: "index_merge_requests_on_title", using: :btree
789
  add_index "merge_requests", ["title"], name: "index_merge_requests_on_title_trigram", using: :gin, opclasses: {"title"=>"gin_trgm_ops"}
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
790

791
  create_table "merge_requests_closing_issues", force: :cascade do |t|
792
793
794
795
    t.integer "merge_request_id", null: false
    t.integer "issue_id", null: false
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
796
797
  end

Timothy Andrew's avatar
Timothy Andrew committed
798
799
800
  add_index "merge_requests_closing_issues", ["issue_id"], name: "index_merge_requests_closing_issues_on_issue_id", using: :btree
  add_index "merge_requests_closing_issues", ["merge_request_id"], name: "index_merge_requests_closing_issues_on_merge_request_id", using: :btree

Valery Sizov's avatar
Valery Sizov committed
801
  create_table "milestones", force: :cascade do |t|
802
803
804
805
    t.string "title", null: false
    t.integer "project_id", null: false
    t.text "description"
    t.date "due_date"
806
807
    t.datetime "created_at"
    t.datetime "updated_at"
808
809
810
811
    t.string "state"
    t.integer "iid"
    t.text "title_html"
    t.text "description_html"
812
    t.date "start_date"
813
    t.integer "cached_markdown_version"
Andrew8xx8's avatar
Andrew8xx8 committed
814
815
  end

816
  add_index "milestones", ["description"], name: "index_milestones_on_description_trigram", using: :gin, opclasses: {"description"=>"gin_trgm_ops"}
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
817
  add_index "milestones", ["due_date"], name: "index_milestones_on_due_date", using: :btree
818
  add_index "milestones", ["project_id", "iid"], name: "index_milestones_on_project_id_and_iid", unique: true, using: :btree
819
  add_index "milestones", ["title"], name: "index_milestones_on_title", using: :btree
820
  add_index "milestones", ["title"], name: "index_milestones_on_title_trigram", using: :gin, opclasses: {"title"=>"gin_trgm_ops"}
Andrew8xx8's avatar
Andrew8xx8 committed
821

Valery Sizov's avatar
Valery Sizov committed
822
  create_table "namespaces", force: :cascade do |t|
823
824
825
    t.string "name", null: false
    t.string "path", null: false
    t.integer "owner_id"
826
827
    t.datetime "created_at"
    t.datetime "updated_at"
828
829
830
831
832
    t.string "type"
    t.string "description", default: "", null: false
    t.string "avatar"
    t.boolean "share_with_group_lock", default: false
    t.integer "visibility_level", default: 20, null: false
833
    t.boolean "request_access_enabled", default: false, null: false
834
    t.datetime "deleted_at"
Nick Thomas's avatar
Nick Thomas committed
835
    t.text "description_html"
836
    t.boolean "lfs_enabled"
837
    t.integer "parent_id"
838
839
    t.boolean "require_two_factor_authentication", default: false, null: false
    t.integer "two_factor_grace_period", default: 48, null: false
840
    t.integer "cached_markdown_version"
Andrew8xx8's avatar
Andrew8xx8 committed
841
842
  end

843
  add_index "namespaces", ["created_at"], name: "index_namespaces_on_created_at", using: :btree
844
  add_index "namespaces", ["deleted_at"], name: "index_namespaces_on_deleted_at", using: :btree
845
  add_index "namespaces", ["name", "parent_id"], name: "index_namespaces_on_name_and_parent_id", unique: true, using: :btree
846
  add_index "namespaces", ["name"], name: "index_namespaces_on_name_trigram", using: :gin, opclasses: {"name"=>"gin_trgm_ops"}
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
847
  add_index "namespaces", ["owner_id"], name: "index_namespaces_on_owner_id", using: :btree
848
  add_index "namespaces", ["parent_id", "id"], name: "index_namespaces_on_parent_id_and_id", unique: true, using: :btree
849
  add_index "namespaces", ["path"], name: "index_namespaces_on_path", using: :btree
850
  add_index "namespaces", ["path"], name: "index_namespaces_on_path_trigram", using: :gin, opclasses: {"path"=>"gin_trgm_ops"}
851
  add_index "namespaces", ["require_two_factor_authentication"], name: "index_namespaces_on_require_two_factor_authentication", using: :btree
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
852
  add_index "namespaces", ["type"], name: "index_namespaces_on_type", using: :btree
Andrew8xx8's avatar
Andrew8xx8 committed
853

Valery Sizov's avatar
Valery Sizov committed
854
  create_table "notes", force: :cascade do |t|
855
856
857
    t.text "note"
    t.string "noteable_type"
    t.integer "author_id"
858
859
    t.datetime "created_at"
    t.datetime "updated_at"
860
861
862
863
864
865
866
867
868
869
870
    t.integer "project_id"
    t.string "attachment"
    t.string "line_code"
    t.string "commit_id"
    t.integer "noteable_id"
    t.boolean "system", default: false, null: false
    t.text "st_diff"
    t.integer "updated_by_id"
    t.string "type"
    t.text "position"
    t.text "original_position"
871
    t.datetime "resolved_at"
872
873
874
    t.integer "resolved_by_id"
    t.string "discussion_id"
    t.text "note_html"
875
    t.integer "cached_markdown_version"
876
    t.text "change_position"
Andrew8xx8's avatar
Andrew8xx8 committed
877
878
  end

Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
879
880
881
  add_index "notes", ["author_id"], name: "index_notes_on_author_id", using: :btree
  add_index "notes", ["commit_id"], name: "index_notes_on_commit_id", using: :btree
  add_index "notes", ["created_at"], name: "index_notes_on_created_at", using: :btree
882
  add_index "notes", ["discussion_id"], name: "index_notes_on_discussion_id", using: :btree
883
  add_index "notes", ["line_code"], name: "index_notes_on_line_code", using: :btree
884
  add_index "notes", ["note"], name: "index_notes_on_note_trigram", using: :gin, opclasses: {"note"=>"gin_trgm_ops"}
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
885
886
887
  add_index "notes", ["noteable_id", "noteable_type"], name: "index_notes_on_noteable_id_and_noteable_type", using: :btree
  add_index "notes", ["noteable_type"], name: "index_notes_on_noteable_type", using: :btree
  add_index "notes", ["project_id", "noteable_type"], name: "index_notes_on_project_id_and_noteable_type", using: :btree
888
  add_index "notes", ["updated_at"], name: "index_notes_on_updated_at", using: :btree
Andrew8xx8's avatar
Andrew8xx8 committed
889

890
  create_table "notification_settings", force: :cascade do |t|
891
892
893
894
895
896
897
    t.integer "user_id", null: false
    t.integer "source_id"
    t.string "source_type"
    t.integer "level", default: 0, null: false
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
    t.text "events"
898
899
900
901
902
903
904
905
906
907
908
909
    t.boolean "new_note"
    t.boolean "new_issue"
    t.boolean "reopen_issue"
    t.boolean "close_issue"
    t.boolean "reassign_issue"
    t.boolean "new_merge_request"
    t.boolean "reopen_merge_request"
    t.boolean "close_merge_request"
    t.boolean "reassign_merge_request"
    t.boolean "merge_merge_request"
    t.boolean "failed_pipeline"
    t.boolean "success_pipeline"
910
911
  end

912
  add_index "notification_settings", ["source_id", "source_type"], name: "index_notification_settings_on_source_id_and_source_type", using: :btree
913
  add_index "notification_settings", ["user_id", "source_id", "source_type"], name: "index_notifications_on_user_id_and_source_id_and_source_type", unique: true, using: :btree
914
915
  add_index "notification_settings", ["user_id"], name: "index_notification_settings_on_user_id", using: :btree

Valery Sizov's avatar
Valery Sizov committed
916
  create_table "oauth_access_grants", force: :cascade do |t|
917
918
919
920
921
922
    t.integer "resource_owner_id", null: false
    t.integer "application_id", null: false
    t.string "token", null: false
    t.integer "expires_in", null: false
    t.text "redirect_uri", null: false
    t.datetime "created_at", null: false
Valery Sizov's avatar
Valery Sizov committed
923
    t.datetime "revoked_at"
924
    t.string "scopes"
Valery Sizov's avatar
Valery Sizov committed
925
926
927
928
  end

  add_index "oauth_access_grants", ["token"], name: "index_oauth_access_grants_on_token", unique: true, using: :btree

Valery Sizov's avatar
Valery Sizov committed
929
  create_table "oauth_access_tokens", force: :cascade do |t|
930
931
932
933
934
    t.integer "resource_owner_id"
    t.integer "application_id"
    t