schema.rb 63.8 KB
Newer Older
A
Andrew8xx8 已提交
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).
#
D
Dmitriy Zaporozhets 已提交
12
# It's strongly recommended that you check this file into your version control system.
A
Andrew8xx8 已提交
13

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

V
Valery Sizov 已提交
16
  create_table "abuse_reports", force: :cascade do |t|
17 18 19
    t.integer "reporter_id", limit: 4
    t.integer "user_id", limit: 4
    t.text "message", limit: 65535
20 21
    t.datetime "created_at"
    t.datetime "updated_at"
22
    t.text "message_html", limit: 65535
23 24
  end

25
  create_table "appearances", force: :cascade do |t|
26 27 28 29 30 31 32 33
    t.string "title", limit: 255
    t.text "description", limit: 65535
    t.string "logo", limit: 255
    t.integer "updated_by", limit: 4
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string "header_logo", limit: 255
    t.text "description_html", limit: 65535
34 35
  end

V
Valery Sizov 已提交
36
  create_table "application_settings", force: :cascade do |t|
37
    t.integer "default_projects_limit", limit: 4
38 39 40
    t.boolean "signup_enabled"
    t.boolean "signin_enabled"
    t.boolean "gravatar_enabled"
41
    t.text "sign_in_text", limit: 65535
42 43
    t.datetime "created_at"
    t.datetime "updated_at"
44 45 46 47
    t.string "home_page_url", limit: 255
    t.integer "default_branch_protection", limit: 4, default: 2
    t.text "help_text", limit: 65535
    t.text "restricted_visibility_levels", limit: 65535
48
    t.boolean "version_check_enabled", default: true
49 50 51 52
    t.integer "max_attachment_size", limit: 4, default: 10, null: false
    t.integer "default_project_visibility", limit: 4
    t.integer "default_snippet_visibility", limit: 4
    t.text "domain_whitelist", limit: 65535
53
    t.boolean "user_oauth_applications", default: true
54 55 56 57 58
    t.string "after_sign_out_path", limit: 255
    t.integer "session_expire_delay", limit: 4, default: 10080, null: false
    t.text "import_sources", limit: 65535
    t.text "help_page_text", limit: 65535
    t.string "admin_notification_email", limit: 255
59
    t.boolean "shared_runners_enabled", default: true, null: false
60 61 62
    t.integer "max_artifacts_size", limit: 4, default: 100, null: false
    t.string "runners_registration_token", limit: 255
    t.integer "max_pages_size", limit: 4, default: 100, null: false
63
    t.boolean "require_two_factor_authentication", default: false
64
    t.integer "two_factor_grace_period", limit: 4, default: 48
65
    t.boolean "metrics_enabled", default: false
66 67 68 69
    t.string "metrics_host", limit: 255, default: "localhost"
    t.integer "metrics_pool_size", limit: 4, default: 16
    t.integer "metrics_timeout", limit: 4, default: 10
    t.integer "metrics_method_call_threshold", limit: 4, default: 10
70
    t.boolean "recaptcha_enabled", default: false
71 72 73
    t.string "recaptcha_site_key", limit: 255
    t.string "recaptcha_private_key", limit: 255
    t.integer "metrics_port", limit: 4, default: 8089
74
    t.boolean "akismet_enabled", default: false
75 76
    t.string "akismet_api_key", limit: 255
    t.integer "metrics_sample_interval", limit: 4, default: 15
77
    t.boolean "sentry_enabled", default: false
78
    t.string "sentry_dsn", limit: 255
79
    t.boolean "email_author_in_body", default: false
80
    t.integer "default_group_visibility", limit: 4
81
    t.boolean "repository_checks_enabled", default: false
82 83 84 85
    t.text "shared_runners_text", limit: 65535
    t.integer "metrics_packet_size", limit: 4, default: 1
    t.text "disabled_oauth_sign_in_sources", limit: 65535
    t.string "health_check_access_token", limit: 255
86
    t.boolean "send_user_confirmation_email", default: false
87 88
    t.integer "container_registry_token_expire_delay", limit: 4, default: 5
    t.text "after_sign_up_text", limit: 65535
89
    t.boolean "user_default_external", default: false, null: false
90 91 92 93 94 95
    t.boolean "elasticsearch_indexing", default: false, null: false
    t.boolean "elasticsearch_search", default: false, null: false
    t.string "elasticsearch_host", limit: 255, default: "localhost"
    t.string "elasticsearch_port", limit: 255, default: "9200"
    t.string "repository_storages", limit: 255, default: "default"
    t.string "enabled_git_access_protocol", limit: 255
96
    t.boolean "domain_blacklist_enabled", default: false
97 98
    t.text "domain_blacklist", limit: 65535
    t.boolean "usage_ping_enabled", default: true, null: false
99
    t.boolean "koding_enabled"
100 101 102 103 104 105 106
    t.string "koding_url", limit: 255
    t.integer "repository_size_limit", limit: 4, default: 0
    t.text "sign_in_text_html", limit: 65535
    t.text "help_page_text_html", limit: 65535
    t.text "shared_runners_text_html", limit: 65535
    t.text "after_sign_up_text_html", limit: 65535
    t.boolean "user_activity_enabled", default: true, null: false
J
Jacob Vosmaer 已提交
107 108
    t.boolean "housekeeping_enabled", default: true, null: false
    t.boolean "housekeeping_bitmaps_enabled", default: true, null: false
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129
    t.integer "housekeeping_incremental_repack_period", limit: 4, default: 10, null: false
    t.integer "housekeeping_full_repack_period", limit: 4, default: 50, null: false
    t.integer "housekeeping_gc_period", limit: 4, default: 200, null: false
    t.boolean "sidekiq_throttling_enabled", default: false
    t.string "sidekiq_throttling_queues", limit: 255
    t.decimal "sidekiq_throttling_factor", precision: 10
  end

  create_table "approvals", force: :cascade do |t|
    t.integer "merge_request_id", limit: 4, null: false
    t.integer "user_id", limit: 4, null: false
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "approver_groups", force: :cascade do |t|
    t.integer "target_id", limit: 4, null: false
    t.string "target_type", limit: 255, null: false
    t.integer "group_id", limit: 4, null: false
    t.datetime "created_at"
    t.datetime "updated_at"
130 131
  end

132 133 134 135 136 137 138 139 140 141 142 143 144 145
  add_index "approver_groups", ["group_id"], name: "index_approver_groups_on_group_id", using: :btree
  add_index "approver_groups", ["target_id", "target_type"], name: "index_approver_groups_on_target_id_and_target_type", using: :btree

  create_table "approvers", force: :cascade do |t|
    t.integer "target_id", limit: 4, null: false
    t.string "target_type", limit: 255
    t.integer "user_id", limit: 4, null: false
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "approvers", ["target_id", "target_type"], name: "index_approvers_on_target_id_and_target_type", using: :btree
  add_index "approvers", ["user_id"], name: "index_approvers_on_user_id", using: :btree

V
Valery Sizov 已提交
146
  create_table "audit_events", force: :cascade do |t|
147 148 149 150 151
    t.integer "author_id", limit: 4, null: false
    t.string "type", limit: 255, null: false
    t.integer "entity_id", limit: 4, null: false
    t.string "entity_type", limit: 255, null: false
    t.text "details", limit: 65535
V
Valery Sizov 已提交
152 153 154 155 156 157
    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

158
  create_table "award_emoji", force: :cascade do |t|
159 160 161 162
    t.string "name", limit: 255
    t.integer "user_id", limit: 4
    t.integer "awardable_id", limit: 4
    t.string "awardable_type", limit: 255
163 164 165 166
    t.datetime "created_at"
    t.datetime "updated_at"
  end

Z
Z.J. van de Weg 已提交
167
  add_index "award_emoji", ["awardable_type", "awardable_id"], name: "index_award_emoji_on_awardable_type_and_awardable_id", using: :btree
168
  add_index "award_emoji", ["user_id", "name"], name: "index_award_emoji_on_user_id_and_name", using: :btree
169 170
  add_index "award_emoji", ["user_id"], name: "index_award_emoji_on_user_id", using: :btree

D
Douglas Barbosa Alexandre 已提交
171
  create_table "boards", force: :cascade do |t|
172
    t.integer "project_id", limit: 4, null: false
D
Douglas Barbosa Alexandre 已提交
173 174
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
175
    t.string "name", limit: 255, default: "Development", null: false
D
Douglas Barbosa Alexandre 已提交
176 177 178 179
  end

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

V
Valery Sizov 已提交
180
  create_table "broadcast_messages", force: :cascade do |t|
181
    t.text "message", limit: 65535, null: false
182 183
    t.datetime "starts_at"
    t.datetime "ends_at"
184 185
    t.datetime "created_at"
    t.datetime "updated_at"
186 187 188
    t.string "color", limit: 255
    t.string "font", limit: 255
    t.text "message_html", limit: 65535
189
  end
190

V
Valery Sizov 已提交
191
  create_table "ci_application_settings", force: :cascade do |t|
192 193
    t.boolean "all_broken_builds"
    t.boolean "add_pusher"
D
Douwe Maan 已提交
194 195 196 197
    t.datetime "created_at"
    t.datetime "updated_at"
  end

V
Valery Sizov 已提交
198
  create_table "ci_builds", force: :cascade do |t|
199 200
    t.integer "project_id", limit: 4
    t.string "status", limit: 255
D
Douwe Maan 已提交
201
    t.datetime "finished_at"
202
    t.text "trace", limit: 65535
D
Douwe Maan 已提交
203 204 205
    t.datetime "created_at"
    t.datetime "updated_at"
    t.datetime "started_at"
206 207 208 209 210 211
    t.integer "runner_id", limit: 4
    t.float "coverage", limit: 24
    t.integer "commit_id", limit: 4
    t.text "commands", limit: 65535
    t.integer "job_id", limit: 4
    t.string "name", limit: 255
212
    t.boolean "deploy", default: false
213
    t.text "options", limit: 65535
214
    t.boolean "allow_failure", default: false, null: false
215 216 217
    t.string "stage", limit: 255
    t.integer "trigger_request_id", limit: 4
    t.integer "stage_idx", limit: 4
218
    t.boolean "tag"
219 220 221 222 223 224 225 226 227
    t.string "ref", limit: 255
    t.integer "user_id", limit: 4
    t.string "type", limit: 255
    t.string "target_url", limit: 255
    t.string "description", limit: 255
    t.text "artifacts_file", limit: 65535
    t.integer "gl_project_id", limit: 4
    t.text "artifacts_metadata", limit: 65535
    t.integer "erased_by_id", limit: 4
228
    t.datetime "erased_at"
229
    t.datetime "artifacts_expire_at"
230
    t.string "environment", limit: 255
231
    t.integer "artifacts_size", limit: 8
232 233
    t.string "when", limit: 255
    t.text "yaml_variables", limit: 65535
234
    t.datetime "queued_at"
235 236
    t.string "token", limit: 255
    t.integer "lock_version", limit: 4
D
Douwe Maan 已提交
237 238
  end

K
Kamil Trzcinski 已提交
239
  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
240
  add_index "ci_builds", ["commit_id", "status", "type"], name: "index_ci_builds_on_commit_id_and_status_and_type", using: :btree
K
Kamil Trzcinski 已提交
241 242
  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
D
Douwe Maan 已提交
243
  add_index "ci_builds", ["commit_id"], name: "index_ci_builds_on_commit_id", using: :btree
K
Kamil Trzcinski 已提交
244
  add_index "ci_builds", ["gl_project_id"], name: "index_ci_builds_on_gl_project_id", using: :btree
D
Douwe Maan 已提交
245 246
  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
247
  add_index "ci_builds", ["status"], name: "index_ci_builds_on_status", using: :btree
K
Kamil Trzcinski 已提交
248
  add_index "ci_builds", ["token"], name: "index_ci_builds_on_token", unique: true, using: :btree
D
Douwe Maan 已提交
249

V
Valery Sizov 已提交
250
  create_table "ci_commits", force: :cascade do |t|
251 252 253 254 255
    t.integer "project_id", limit: 4
    t.string "ref", limit: 255
    t.string "sha", limit: 255
    t.string "before_sha", limit: 255
    t.text "push_data", limit: 65535
D
Douwe Maan 已提交
256 257
    t.datetime "created_at"
    t.datetime "updated_at"
258
    t.boolean "tag", default: false
259
    t.text "yaml_errors", limit: 65535
D
Douwe Maan 已提交
260
    t.datetime "committed_at"
261 262
    t.integer "gl_project_id", limit: 4
    t.string "status", limit: 255
263 264
    t.datetime "started_at"
    t.datetime "finished_at"
265 266 267
    t.integer "duration", limit: 4
    t.integer "user_id", limit: 4
    t.integer "lock_version", limit: 4
D
Douwe Maan 已提交
268 269
  end

270 271
  add_index "ci_commits", ["gl_project_id", "sha"], name: "index_ci_commits_on_gl_project_id_and_sha", using: :btree
  add_index "ci_commits", ["gl_project_id", "status"], name: "index_ci_commits_on_gl_project_id_and_status", using: :btree
272
  add_index "ci_commits", ["gl_project_id"], name: "index_ci_commits_on_gl_project_id", using: :btree
273
  add_index "ci_commits", ["status"], name: "index_ci_commits_on_status", using: :btree
274
  add_index "ci_commits", ["user_id"], name: "index_ci_commits_on_user_id", using: :btree
D
Douwe Maan 已提交
275

V
Valery Sizov 已提交
276
  create_table "ci_events", force: :cascade do |t|
277 278 279 280
    t.integer "project_id", limit: 4
    t.integer "user_id", limit: 4
    t.integer "is_admin", limit: 4
    t.text "description", limit: 65535
D
Douwe Maan 已提交
281 282 283 284
    t.datetime "created_at"
    t.datetime "updated_at"
  end

V
Valery Sizov 已提交
285
  create_table "ci_jobs", force: :cascade do |t|
286 287
    t.integer "project_id", limit: 4, null: false
    t.text "commands", limit: 65535
288
    t.boolean "active", default: true, null: false
D
Douwe Maan 已提交
289 290
    t.datetime "created_at"
    t.datetime "updated_at"
291
    t.string "name", limit: 255
292 293
    t.boolean "build_branches", default: true, null: false
    t.boolean "build_tags", default: false, null: false
294 295
    t.string "job_type", limit: 255, default: "parallel"
    t.string "refs", limit: 255
D
Douwe Maan 已提交
296 297 298
    t.datetime "deleted_at"
  end

V
Valery Sizov 已提交
299
  create_table "ci_projects", force: :cascade do |t|
300 301
    t.string "name", limit: 255
    t.integer "timeout", limit: 4, default: 3600, null: false
D
Douwe Maan 已提交
302 303
    t.datetime "created_at"
    t.datetime "updated_at"
304 305 306
    t.string "token", limit: 255
    t.string "default_ref", limit: 255
    t.string "path", limit: 255
307
    t.boolean "always_build", default: false, null: false
308
    t.integer "polling_interval", limit: 4
309
    t.boolean "public", default: false, null: false
310 311
    t.string "ssh_url_to_repo", limit: 255
    t.integer "gitlab_id", limit: 4
312
    t.boolean "allow_git_fetch", default: true, null: false
313
    t.string "email_recipients", limit: 255, default: "", null: false
314 315
    t.boolean "email_add_pusher", default: true, null: false
    t.boolean "email_only_broken_builds", default: true, null: false
316 317
    t.string "skip_refs", limit: 255
    t.string "coverage_regex", limit: 255
318
    t.boolean "shared_runners_enabled", default: false
319
    t.text "generated_yaml_config", limit: 65535
D
Douwe Maan 已提交
320 321
  end

V
Valery Sizov 已提交
322
  create_table "ci_runner_projects", force: :cascade do |t|
323 324
    t.integer "runner_id", limit: 4, null: false
    t.integer "project_id", limit: 4
D
Douwe Maan 已提交
325 326
    t.datetime "created_at"
    t.datetime "updated_at"
327
    t.integer "gl_project_id", limit: 4
D
Douwe Maan 已提交
328 329
  end

K
Kamil Trzcinski 已提交
330
  add_index "ci_runner_projects", ["gl_project_id"], name: "index_ci_runner_projects_on_gl_project_id", using: :btree
D
Douwe Maan 已提交
331 332
  add_index "ci_runner_projects", ["runner_id"], name: "index_ci_runner_projects_on_runner_id", using: :btree

V
Valery Sizov 已提交
333
  create_table "ci_runners", force: :cascade do |t|
334
    t.string "token", limit: 255
D
Douwe Maan 已提交
335 336
    t.datetime "created_at"
    t.datetime "updated_at"
337
    t.string "description", limit: 255
D
Douwe Maan 已提交
338
    t.datetime "contacted_at"
339 340
    t.boolean "active", default: true, null: false
    t.boolean "is_shared", default: false
341 342 343 344 345
    t.string "name", limit: 255
    t.string "version", limit: 255
    t.string "revision", limit: 255
    t.string "platform", limit: 255
    t.string "architecture", limit: 255
346 347
    t.boolean "run_untagged", default: true, null: false
    t.boolean "locked", default: false, null: false
D
Douwe Maan 已提交
348 349
  end

350
  add_index "ci_runners", ["locked"], name: "index_ci_runners_on_locked", using: :btree
J
James Lopez 已提交
351
  add_index "ci_runners", ["token"], name: "index_ci_runners_on_token", using: :btree
352

V
Valery Sizov 已提交
353
  create_table "ci_sessions", force: :cascade do |t|
354 355
    t.string "session_id", limit: 255, null: false
    t.text "data", limit: 65535
D
Douwe Maan 已提交
356 357 358 359
    t.datetime "created_at"
    t.datetime "updated_at"
  end

V
Valery Sizov 已提交
360
  create_table "ci_taggings", force: :cascade do |t|
361 362 363 364 365
    t.integer "tag_id", limit: 4
    t.integer "taggable_id", limit: 4
    t.string "taggable_type", limit: 255
    t.integer "tagger_id", limit: 4
    t.string "tagger_type", limit: 255
366
    t.string "context", limit: 128
367 368 369 370 371
    t.datetime "created_at"
  end

  add_index "ci_taggings", ["taggable_id", "taggable_type", "context"], name: "index_ci_taggings_on_taggable_id_and_taggable_type_and_context", using: :btree

V
Valery Sizov 已提交
372
  create_table "ci_tags", force: :cascade do |t|
373 374
    t.string "name", limit: 255
    t.integer "taggings_count", limit: 4, default: 0
375 376
  end

V
Valery Sizov 已提交
377
  create_table "ci_trigger_requests", force: :cascade do |t|
378 379
    t.integer "trigger_id", limit: 4, null: false
    t.text "variables", limit: 65535
D
Douwe Maan 已提交
380 381
    t.datetime "created_at"
    t.datetime "updated_at"
382
    t.integer "commit_id", limit: 4
D
Douwe Maan 已提交
383 384
  end

V
Valery Sizov 已提交
385
  create_table "ci_triggers", force: :cascade do |t|
386 387
    t.string "token", limit: 255
    t.integer "project_id", limit: 4
D
Douwe Maan 已提交
388 389 390
    t.datetime "deleted_at"
    t.datetime "created_at"
    t.datetime "updated_at"
391
    t.integer "gl_project_id", limit: 4
D
Douwe Maan 已提交
392 393
  end

K
Kamil Trzcinski 已提交
394
  add_index "ci_triggers", ["gl_project_id"], name: "index_ci_triggers_on_gl_project_id", using: :btree
D
Douwe Maan 已提交
395

V
Valery Sizov 已提交
396
  create_table "ci_variables", force: :cascade do |t|
397 398 399 400 401 402 403
    t.integer "project_id", limit: 4
    t.string "key", limit: 255
    t.text "value", limit: 65535
    t.text "encrypted_value", limit: 65535
    t.string "encrypted_value_salt", limit: 255
    t.string "encrypted_value_iv", limit: 255
    t.integer "gl_project_id", limit: 4
D
Douwe Maan 已提交
404 405
  end

K
Kamil Trzcinski 已提交
406
  add_index "ci_variables", ["gl_project_id"], name: "index_ci_variables_on_gl_project_id", using: :btree
D
Douwe Maan 已提交
407

V
Valery Sizov 已提交
408
  create_table "deploy_keys_projects", force: :cascade do |t|
409 410
    t.integer "deploy_key_id", limit: 4, null: false
    t.integer "project_id", limit: 4, null: false
411 412
    t.datetime "created_at"
    t.datetime "updated_at"
413
  end
414

D
Dmitriy Zaporozhets 已提交
415
  add_index "deploy_keys_projects", ["project_id"], name: "index_deploy_keys_projects_on_project_id", using: :btree
D
Dmitriy Zaporozhets 已提交
416

417
  create_table "deployments", force: :cascade do |t|
418 419 420 421
    t.integer "iid", limit: 4, null: false
    t.integer "project_id", limit: 4, null: false
    t.integer "environment_id", limit: 4, null: false
    t.string "ref", limit: 255, null: false
422
    t.boolean "tag", null: false
423 424 425 426
    t.string "sha", limit: 255, null: false
    t.integer "user_id", limit: 4
    t.integer "deployable_id", limit: 4
    t.string "deployable_type", limit: 255
427 428
    t.datetime "created_at"
    t.datetime "updated_at"
429
    t.string "on_stop", limit: 255
430 431 432 433
  end

  add_index "deployments", ["project_id", "environment_id", "iid"], name: "index_deployments_on_project_id_and_environment_id_and_iid", using: :btree
  add_index "deployments", ["project_id", "environment_id"], name: "index_deployments_on_project_id_and_environment_id", using: :btree
434
  add_index "deployments", ["project_id", "iid"], name: "index_deployments_on_project_id_and_iid", unique: true, using: :btree
435 436
  add_index "deployments", ["project_id"], name: "index_deployments_on_project_id", using: :btree

V
Valery Sizov 已提交
437
  create_table "emails", force: :cascade do |t|
438 439
    t.integer "user_id", limit: 4, null: false
    t.string "email", limit: 255, null: false
440 441 442 443 444 445 446
    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

447
  create_table "environments", force: :cascade do |t|
448 449
    t.integer "project_id", limit: 4
    t.string "name", limit: 255, null: false
450 451
    t.datetime "created_at"
    t.datetime "updated_at"
452 453 454
    t.string "external_url", limit: 255
    t.string "environment_type", limit: 255
    t.string "state", limit: 255, default: "available", null: false
455 456 457 458
  end

  add_index "environments", ["project_id", "name"], name: "index_environments_on_project_id_and_name", using: :btree

V
Valery Sizov 已提交
459
  create_table "events", force: :cascade do |t|
460 461 462 463 464
    t.string "target_type", limit: 255
    t.integer "target_id", limit: 4
    t.string "title", limit: 255
    t.text "data", limit: 4294967295
    t.integer "project_id", limit: 4
465 466
    t.datetime "created_at"
    t.datetime "updated_at"
467 468
    t.integer "action", limit: 4
    t.integer "author_id", limit: 4
A
Andrew8xx8 已提交
469 470
  end

D
Dmitriy Zaporozhets 已提交
471 472 473 474 475 476 477
  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

V
Valery Sizov 已提交
478
  create_table "forked_project_links", force: :cascade do |t|
479 480
    t.integer "forked_to_project_id", limit: 4, null: false
    t.integer "forked_from_project_id", limit: 4, null: false
481 482
    t.datetime "created_at"
    t.datetime "updated_at"
483 484
  end

D
Dmitriy Zaporozhets 已提交
485
  add_index "forked_project_links", ["forked_to_project_id"], name: "index_forked_project_links_on_forked_to_project_id", unique: true, using: :btree
486

487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507
  create_table "geo_nodes", force: :cascade do |t|
    t.string "schema", limit: 255
    t.string "host", limit: 255
    t.integer "port", limit: 4
    t.string "relative_url_root", limit: 255
    t.boolean "primary"
    t.integer "geo_node_key_id", limit: 4
    t.integer "oauth_application_id", limit: 4
    t.integer "system_hook_id", limit: 4
  end

  add_index "geo_nodes", ["host"], name: "index_geo_nodes_on_host", using: :btree
  add_index "geo_nodes", ["primary"], name: "index_geo_nodes_on_primary", using: :btree

  create_table "historical_data", force: :cascade do |t|
    t.date "date", null: false
    t.integer "active_user_count", limit: 4
    t.datetime "created_at"
    t.datetime "updated_at"
  end

V
Valery Sizov 已提交
508
  create_table "identities", force: :cascade do |t|
509 510 511
    t.string "extern_uid", limit: 255
    t.string "provider", limit: 255
    t.integer "user_id", limit: 4
D
Dmitriy Zaporozhets 已提交
512 513
    t.datetime "created_at"
    t.datetime "updated_at"
514
    t.string "secondary_extern_uid", limit: 255
515 516 517 518
  end

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

519 520 521 522 523 524 525 526 527 528 529
  create_table "index_statuses", force: :cascade do |t|
    t.integer "project_id", limit: 4, null: false
    t.datetime "indexed_at"
    t.text "note", limit: 65535
    t.string "last_commit", limit: 255
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
  end

  add_index "index_statuses", ["project_id"], name: "index_index_statuses_on_project_id", unique: true, using: :btree

T
Timothy Andrew 已提交
530
  create_table "issue_metrics", force: :cascade do |t|
531
    t.integer "issue_id", limit: 4, null: false
532
    t.datetime "first_mentioned_in_commit_at"
T
Timothy Andrew 已提交
533 534
    t.datetime "first_associated_with_milestone_at"
    t.datetime "first_added_to_board_at"
535 536
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
T
Timothy Andrew 已提交
537 538 539 540
  end

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

V
Valery Sizov 已提交
541
  create_table "issues", force: :cascade do |t|
542 543 544 545
    t.string "title", limit: 255
    t.integer "assignee_id", limit: 4
    t.integer "author_id", limit: 4
    t.integer "project_id", limit: 4
546 547
    t.datetime "created_at"
    t.datetime "updated_at"
548 549 550 551 552 553 554 555
    t.integer "position", limit: 4, default: 0
    t.string "branch_name", limit: 255
    t.text "description", limit: 65535
    t.integer "milestone_id", limit: 4
    t.string "state", limit: 255
    t.integer "iid", limit: 4
    t.integer "updated_by_id", limit: 4
    t.integer "weight", limit: 4
556
    t.boolean "confidential", default: false
557
    t.datetime "deleted_at"
558
    t.date "due_date"
559 560 561 562
    t.integer "moved_to_id", limit: 4
    t.integer "lock_version", limit: 4
    t.text "title_html", limit: 65535
    t.text "description_html", limit: 65535
A
Andrew8xx8 已提交
563 564
  end

D
Dmitriy Zaporozhets 已提交
565 566
  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
567
  add_index "issues", ["confidential"], name: "index_issues_on_confidential", using: :btree
D
Dmitriy Zaporozhets 已提交
568
  add_index "issues", ["created_at"], name: "index_issues_on_created_at", using: :btree
Z
Zeger-Jan van de Weg 已提交
569
  add_index "issues", ["deleted_at"], name: "index_issues_on_deleted_at", using: :btree
570
  add_index "issues", ["due_date"], name: "index_issues_on_due_date", using: :btree
D
Dmitriy Zaporozhets 已提交
571
  add_index "issues", ["milestone_id"], name: "index_issues_on_milestone_id", using: :btree
572
  add_index "issues", ["project_id", "iid"], name: "index_issues_on_project_id_and_iid", unique: true, using: :btree
573
  add_index "issues", ["state"], name: "index_issues_on_state", using: :btree
A
Andrew8xx8 已提交
574

V
Valery Sizov 已提交
575
  create_table "keys", force: :cascade do |t|
576
    t.integer "user_id", limit: 4
577 578
    t.datetime "created_at"
    t.datetime "updated_at"
579 580 581 582
    t.text "key", limit: 65535
    t.string "title", limit: 255
    t.string "type", limit: 255
    t.string "fingerprint", limit: 255
583
    t.boolean "public", default: false, null: false
A
Andrew8xx8 已提交
584 585
  end

586
  add_index "keys", ["fingerprint"], name: "index_keys_on_fingerprint", unique: true, using: :btree
D
Dmitriy Zaporozhets 已提交
587
  add_index "keys", ["user_id"], name: "index_keys_on_user_id", using: :btree
A
Andrew8xx8 已提交
588

V
Valery Sizov 已提交
589
  create_table "label_links", force: :cascade do |t|
590 591 592
    t.integer "label_id", limit: 4
    t.integer "target_id", limit: 4
    t.string "target_type", limit: 255
593 594 595 596
    t.datetime "created_at"
    t.datetime "updated_at"
  end

D
Dmitriy Zaporozhets 已提交
597 598 599
  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

600
  create_table "label_priorities", force: :cascade do |t|
601 602 603
    t.integer "project_id", limit: 4, null: false
    t.integer "label_id", limit: 4, null: false
    t.integer "priority", limit: 4, null: false
604 605 606 607
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
  end

608
  add_index "label_priorities", ["label_id"], name: "fk_rails_e161058b0f", using: :btree
609 610 611
  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

V
Valery Sizov 已提交
612
  create_table "labels", force: :cascade do |t|
613 614 615
    t.string "title", limit: 255
    t.string "color", limit: 255
    t.integer "project_id", limit: 4
616 617
    t.datetime "created_at"
    t.datetime "updated_at"
618
    t.boolean "template", default: false
619 620 621 622
    t.string "description", limit: 255
    t.text "description_html", limit: 65535
    t.string "type", limit: 255
    t.integer "group_id", limit: 4
623 624
  end

625
  add_index "labels", ["group_id", "project_id", "title"], name: "index_labels_on_group_id_and_project_id_and_title", unique: true, using: :btree
D
Douglas Barbosa Alexandre 已提交
626
  add_index "labels", ["group_id"], name: "index_labels_on_group_id", using: :btree
D
Dmitriy Zaporozhets 已提交
627

628 629 630 631 632 633 634 635 636
  create_table "ldap_group_links", force: :cascade do |t|
    t.string "cn", limit: 255, null: false
    t.integer "group_access", limit: 4, null: false
    t.integer "group_id", limit: 4, null: false
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string "provider", limit: 255
  end

V
Valery Sizov 已提交
637
  create_table "lfs_objects", force: :cascade do |t|
638
    t.string "oid", limit: 255, null: false
639
    t.integer "size", limit: 8, null: false
M
Marin Jankovski 已提交
640 641
    t.datetime "created_at"
    t.datetime "updated_at"
642
    t.string "file", limit: 255
M
Marin Jankovski 已提交
643 644
  end

645
  add_index "lfs_objects", ["oid"], name: "index_lfs_objects_on_oid", unique: true, using: :btree
M
Marin Jankovski 已提交
646

V
Valery Sizov 已提交
647
  create_table "lfs_objects_projects", force: :cascade do |t|
648 649
    t.integer "lfs_object_id", limit: 4, null: false
    t.integer "project_id", limit: 4, null: false
M
Marin Jankovski 已提交
650 651 652 653 654 655
    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

656 657 658 659 660 661
  create_table "licenses", force: :cascade do |t|
    t.text "data", limit: 65535, null: false
    t.datetime "created_at"
    t.datetime "updated_at"
  end

D
Douglas Barbosa Alexandre 已提交
662
  create_table "lists", force: :cascade do |t|
663 664 665 666
    t.integer "board_id", limit: 4, null: false
    t.integer "label_id", limit: 4
    t.integer "list_type", limit: 4, default: 1, null: false
    t.integer "position", limit: 4
667 668
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
D
Douglas Barbosa Alexandre 已提交
669 670
  end

671
  add_index "lists", ["board_id", "label_id"], name: "index_lists_on_board_id_and_label_id", unique: true, using: :btree
D
Douglas Barbosa Alexandre 已提交
672 673 674
  add_index "lists", ["board_id"], name: "index_lists_on_board_id", using: :btree
  add_index "lists", ["label_id"], name: "index_lists_on_label_id", using: :btree

V
Valery Sizov 已提交
675
  create_table "members", force: :cascade do |t|
676 677 678 679 680 681
    t.integer "access_level", limit: 4, null: false
    t.integer "source_id", limit: 4, null: false
    t.string "source_type", limit: 255, null: false
    t.integer "user_id", limit: 4
    t.integer "notification_level", limit: 4, null: false
    t.string "type", limit: 255
682 683
    t.datetime "created_at"
    t.datetime "updated_at"
684 685 686
    t.integer "created_by_id", limit: 4
    t.string "invite_email", limit: 255
    t.string "invite_token", limit: 255
D
Douwe Maan 已提交
687
    t.datetime "invite_accepted_at"
R
Rémy Coutable 已提交
688
    t.datetime "requested_at"
689
    t.date "expires_at"
690 691
    t.boolean "ldap", default: false, null: false
    t.boolean "override", default: false, null: false
692 693
  end

694
  add_index "members", ["access_level"], name: "index_members_on_access_level", using: :btree
D
Douwe Maan 已提交
695
  add_index "members", ["invite_token"], name: "index_members_on_invite_token", unique: true, using: :btree
696
  add_index "members", ["requested_at"], name: "index_members_on_requested_at", using: :btree
697 698 699
  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

V
Valery Sizov 已提交
700
  create_table "merge_request_diffs", force: :cascade do |t|
701 702 703 704
    t.string "state", limit: 255
    t.text "st_commits", limit: 4294967295
    t.text "st_diffs", limit: 4294967295
    t.integer "merge_request_id", limit: 4, null: false
705 706
    t.datetime "created_at"
    t.datetime "updated_at"
707 708 709 710
    t.string "base_commit_sha", limit: 255
    t.string "real_size", limit: 255
    t.string "head_commit_sha", limit: 255
    t.string "start_commit_sha", limit: 255
711 712
  end

713
  add_index "merge_request_diffs", ["merge_request_id"], name: "index_merge_request_diffs_on_merge_request_id", using: :btree
714

715
  create_table "merge_request_metrics", force: :cascade do |t|
716
    t.integer "merge_request_id", limit: 4, null: false
717 718
    t.datetime "latest_build_started_at"
    t.datetime "latest_build_finished_at"
T
Timothy Andrew 已提交
719 720
    t.datetime "first_deployed_to_production_at"
    t.datetime "merged_at"
721 722
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
723
    t.integer "pipeline_id", limit: 4
724 725
  end

726
  add_index "merge_request_metrics", ["first_deployed_to_production_at"], name: "index_merge_request_metrics_on_first_deployed_to_production_at", using: :btree
727
  add_index "merge_request_metrics", ["merge_request_id"], name: "index_merge_request_metrics", using: :btree
728
  add_index "merge_request_metrics", ["pipeline_id"], name: "index_merge_request_metrics_on_pipeline_id", using: :btree
729

V
Valery Sizov 已提交
730
  create_table "merge_requests", force: :cascade do |t|
731 732 733 734 735 736
    t.string "target_branch", limit: 255, null: false
    t.string "source_branch", limit: 255, null: false
    t.integer "source_project_id", limit: 4, null: false
    t.integer "author_id", limit: 4
    t.integer "assignee_id", limit: 4
    t.string "title", limit: 255
737 738
    t.datetime "created_at"
    t.datetime "updated_at"
739 740 741 742 743 744 745
    t.integer "milestone_id", limit: 4
    t.string "state", limit: 255
    t.string "merge_status", limit: 255
    t.integer "target_project_id", limit: 4, null: false
    t.integer "iid", limit: 4
    t.text "description", limit: 65535
    t.integer "position", limit: 4, default: 0
746
    t.datetime "locked_at"
747 748 749
    t.integer "updated_by_id", limit: 4
    t.text "merge_error", limit: 65535
    t.text "merge_params", limit: 65535
750
    t.boolean "merge_when_build_succeeds", default: false, null: false
751 752
    t.integer "merge_user_id", limit: 4
    t.string "merge_commit_sha", limit: 255
Z
Zeger-Jan van de Weg 已提交
753
    t.datetime "deleted_at"
754 755 756 757 758 759
    t.integer "approvals_before_merge", limit: 4
    t.string "rebase_commit_sha", limit: 255
    t.string "in_progress_merge_commit_sha", limit: 255
    t.integer "lock_version", limit: 4
    t.text "title_html", limit: 65535
    t.text "description_html", limit: 65535
A
Andrew8xx8 已提交
760
  end
T
tiagonbotelho 已提交
761

D
Dmitriy Zaporozhets 已提交
762 763 764
  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
Z
Zeger-Jan van de Weg 已提交
765
  add_index "merge_requests", ["deleted_at"], name: "index_merge_requests_on_deleted_at", using: :btree
D
Dmitriy Zaporozhets 已提交
766 767
  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
768
  add_index "merge_requests", ["source_project_id"], name: "index_merge_requests_on_source_project_id", using: :btree
D
Dmitriy Zaporozhets 已提交
769
  add_index "merge_requests", ["target_branch"], name: "index_merge_requests_on_target_branch", using: :btree
770
  add_index "merge_requests", ["target_project_id", "iid"], name: "index_merge_requests_on_target_project_id_and_iid", unique: true, using: :btree
D
Dmitriy Zaporozhets 已提交
771 772
  add_index "merge_requests", ["title"], name: "index_merge_requests_on_title", using: :btree

773
  create_table "merge_requests_closing_issues", force: :cascade do |t|
774 775
    t.integer "merge_request_id", limit: 4, null: false
    t.integer "issue_id", limit: 4, null: false
776 777
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
778 779
  end

T
Timothy Andrew 已提交
780 781 782
  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

V
Valery Sizov 已提交
783
  create_table "milestones", force: :cascade do |t|
784 785 786
    t.string "title", limit: 255, null: false
    t.integer "project_id", limit: 4, null: false
    t.text "description", limit: 65535
787
    t.date "due_date"
788 789
    t.datetime "created_at"
    t.datetime "updated_at"
790 791 792 793
    t.string "state", limit: 255
    t.integer "iid", limit: 4
    t.text "title_html", limit: 65535
    t.text "description_html", limit: 65535
A
Andrew8xx8 已提交
794 795
  end

D
Dmitriy Zaporozhets 已提交
796
  add_index "milestones", ["due_date"], name: "index_milestones_on_due_date", using: :btree
797
  add_index "milestones", ["project_id", "iid"], name: "index_milestones_on_project_id_and_iid", unique: true, using: :btree
D
Dmitriy Zaporozhets 已提交
798
  add_index "milestones", ["project_id"], name: "index_milestones_on_project_id", using: :btree
799
  add_index "milestones", ["title"], name: "index_milestones_on_title", using: :btree
A
Andrew8xx8 已提交
800

V
Valery Sizov 已提交
801
  create_table "namespaces", force: :cascade do |t|
802 803 804
    t.string "name", limit: 255, null: false
    t.string "path", limit: 255, null: false
    t.integer "owner_id", limit: 4
805 806
    t.datetime "created_at"
    t.datetime "updated_at"
807 808 809 810
    t.string "type", limit: 255
    t.string "description", limit: 255, default: "", null: false
    t.string "avatar", limit: 255
    t.boolean "membership_lock", default: false
811
    t.boolean "share_with_group_lock", default: false
812
    t.integer "visibility_level", limit: 4, default: 20, null: false
813
    t.boolean "request_access_enabled", default: false, null: false
814
    t.datetime "deleted_at"
815 816 817 818 819
    t.string "ldap_sync_status", limit: 255, default: "ready", null: false
    t.string "ldap_sync_error", limit: 255
    t.datetime "ldap_sync_last_update_at"
    t.datetime "ldap_sync_last_successful_update_at"
    t.datetime "ldap_sync_last_sync_at"
820
    t.boolean "lfs_enabled"
821 822
    t.integer "repository_size_limit", limit: 4
    t.text "description_html", limit: 65535
A
Andrew8xx8 已提交
823 824
  end

825
  add_index "namespaces", ["created_at"], name: "index_namespaces_on_created_at", using: :btree
826
  add_index "namespaces", ["deleted_at"], name: "index_namespaces_on_deleted_at", using: :btree
827 828
  add_index "namespaces", ["ldap_sync_last_successful_update_at"], name: "index_namespaces_on_ldap_sync_last_successful_update_at", using: :btree
  add_index "namespaces", ["ldap_sync_last_update_at"], name: "index_namespaces_on_ldap_sync_last_update_at", using: :btree
829
  add_index "namespaces", ["name"], name: "index_namespaces_on_name", unique: true, using: :btree
D
Dmitriy Zaporozhets 已提交
830
  add_index "namespaces", ["owner_id"], name: "index_namespaces_on_owner_id", using: :btree
V
Valery Sizov 已提交
831
  add_index "namespaces", ["path"], name: "index_namespaces_on_path", unique: true, using: :btree
D
Dmitriy Zaporozhets 已提交
832
  add_index "namespaces", ["type"], name: "index_namespaces_on_type", using: :btree
A
Andrew8xx8 已提交
833

V
Valery Sizov 已提交
834
  create_table "notes", force: :cascade do |t|
835 836 837
    t.text "note", limit: 65535
    t.string "noteable_type", limit: 255
    t.integer "author_id", limit: 4
838 839
    t.datetime "created_at"
    t.datetime "updated_at"
840 841 842 843 844
    t.integer "project_id", limit: 4
    t.string "attachment", limit: 255
    t.string "line_code", limit: 255
    t.string "commit_id", limit: 255
    t.integer "noteable_id", limit: 4
845
    t.boolean "system", default: false, null: false
846 847 848 849 850
    t.text "st_diff", limit: 4294967295
    t.integer "updated_by_id", limit: 4
    t.string "type", limit: 255
    t.text "position", limit: 65535
    t.text "original_position", limit: 65535
851
    t.datetime "resolved_at"
852 853 854 855
    t.integer "resolved_by_id", limit: 4
    t.string "discussion_id", limit: 255
    t.string "original_discussion_id", limit: 255
    t.text "note_html", limit: 65535
A
Andrew8xx8 已提交
856 857
  end

D
Dmitriy Zaporozhets 已提交
858 859 860
  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
861
  add_index "notes", ["discussion_id"], name: "index_notes_on_discussion_id", using: :btree
862
  add_index "notes", ["line_code"], name: "index_notes_on_line_code", using: :btree
D
Dmitriy Zaporozhets 已提交
863 864 865 866
  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
  add_index "notes", ["project_id"], name: "index_notes_on_project_id", using: :btree
J
Jacob Vosmaer 已提交
867
  add_index "notes", ["updated_at"], name: "index_notes_on_updated_at", using: :btree
A
Andrew8xx8 已提交
868

869
  create_table "notification_settings", force: :cascade do |t|
870 871 872 873
    t.integer "user_id", limit: 4, null: false
    t.integer "source_id", limit: 4
    t.string "source_type", limit: 255
    t.integer "level", limit: 4, default: 0, null: false
874 875
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
876
    t.text "events", limit: 65535
877 878
  end

879
  add_index "notification_settings", ["source_id", "source_type"], name: "index_notification_settings_on_source_id_and_source_type", using: :btree
880
  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
881 882
  add_index "notification_settings", ["user_id"], name: "index_notification_settings_on_user_id", using: :btree

V
Valery Sizov 已提交
883
  create_table "oauth_access_grants", force: :cascade do |t|
884 885 886 887 888
    t.integer "resource_owner_id", limit: 4, null: false
    t.integer "application_id", limit: 4, null: false
    t.string "token", limit: 255, null: false
    t.integer "expires_in", limit: 4, null: false
    t.text "redirect_uri", limit: 65535, null: false
889
    t.datetime "created_at", null: false
V
Valery Sizov 已提交
890
    t.datetime "revoked_at"
891
    t.string "scopes", limit: 255
V
Valery Sizov 已提交
892 893 894 895
  end

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

V
Valery Sizov 已提交
896
  create_table "oauth_access_tokens", force: :cascade do |t|
897 898 899 900 901
    t.integer "resource_owner_id", limit: 4
    t.integer "application_id", limit: 4
    t.string "token", limit: 255, null: false
    t.string "refresh_token", limit: 255
    t.integer "expires_in", limit: 4
V
Valery Sizov 已提交
902
    t.datetime "revoked_at"
903
    t.datetime "created_at", null: false
904
    t.string "scopes", limit: 255
V
Valery Sizov 已提交
905 906 907 908 909 910
  end

  add_index "oauth_access_tokens", ["refresh_token"], name: "index_oauth_access_tokens_on_refresh_token", unique: true, using: :btree
  add_index "oauth_access_tokens", ["resource_owner_id"], name: "index_oauth_access_tokens_on_resource_owner_id", using: :btree
  add_index "oauth_access_tokens", ["token"], name: "index_oauth_access_tokens_on_token", unique: true, using: :btree

V
Valery Sizov 已提交
911
  create_table "oauth_applications", force: :cascade do |t|
912 913 914 915 916
    t.string "name", limit: 255, null: false
    t.string "uid", limit: 255, null: false
    t.string "secret", limit: 255, null: false
    t.text "redirect_uri", limit: 65535, null: false
    t.string "scopes", limit: 255, default: "", null: false
V
Valery Sizov 已提交
917 918
    t.datetime "created_at"
    t.datetime "updated_at"
919 920
    t.integer "owner_id", limit: 4
    t.string "owner_type", limit: 255
V
Valery Sizov 已提交
921 922 923 924 925
  end

  add_index "oauth_applications", ["owner_id", "owner_type"], name: "index_oauth_applications_on_owner_id_and_owner_type", using: :btree
  add_index "oauth_applications", ["uid"], name: "index_oauth_applications_on_uid", unique: true, using: :btree

926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948
  create_table "pages_domains", force: :cascade do |t|
    t.integer "project_id", limit: 4
    t.text "certificate", limit: 65535
    t.text "encrypted_key", limit: 65535
    t.string "encrypted_key_iv", limit: 255
    t.string "encrypted_key_salt", limit: 255
    t.string "domain", limit: 255
  end

  add_index "pages_domains", ["domain"], name: "index_pages_domains_on_domain", unique: true, using: :btree

  create_table "path_locks", force: :cascade do |t|
    t.string "path", limit: 255, null: false
    t.integer "project_id", limit: 4
    t.integer "user_id", limit: 4
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
  end

  add_index "path_locks", ["path"], name: "index_path_locks_on_path", using: :btree
  add_index "path_locks", ["project_id"], name: "index_path_locks_on_project_id", using: :btree
  add_index "path_locks", ["user_id"], name: "index_path_locks_on_user_id", using: :btree

949
  create_table "personal_access_tokens", force: :cascade do |t|
950 951 952
    t.integer "user_id", limit: 4, null: false
    t.string "token", limit: 255, null: false
    t.string "name", limit: 255, null: false
953
    t.boolean "revoked", default: false
954
    t.datetime "expires_at"
955 956
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
957 958 959 960 961
  end

  add_index "personal_access_tokens", ["token"], name: "index_personal_access_tokens_on_token", unique: true, using: :btree
  add_index "personal_access_tokens", ["user_id"], name: "index_personal_access_tokens_on_user_id", using: :btree

F
Felipe Artur 已提交
962
  create_table "project_features", force: :cascade do |t|
963 964 965 966 967 968
    t.integer "project_id", limit: 4
    t.integer "merge_requests_access_level", limit: 4
    t.integer "issues_access_level", limit: 4
    t.integer "wiki_access_level", limit: 4
    t.integer "snippets_access_level", limit: 4
    t.integer "builds_access_level", limit: 4
F
Felipe Artur 已提交
969 970
    t.datetime "created_at"
    t.datetime "updated_at"
971
    t.integer "repository_access_level", limit: 4, default: 20, null: false
F
Felipe Artur 已提交
972 973 974 975
  end

  add_index "project_features", ["project_id"], name: "index_project_features_on_project_id", using: :btree

976
  create_table "project_group_links", force: :cascade do |t|
977 978
    t.integer "project_id", limit: 4, null: false
    t.integer "group_id", limit: 4, null: false
979 980
    t.datetime "created_at"
    t.datetime "updated_at"
981
    t.integer "group_access", limit: 4, default: 30, null: false
982
    t.date "expires_at"
983 984
  end

V
Valery Sizov 已提交
985
  create_table "project_import_data", force: :cascade do |t|
986 987 988 989 990
    t.integer "project_id", limit: 4
    t.text "data", limit: 65535
    t.text "encrypted_credentials", limit: 65535
    t.string "encrypted_credentials_iv", limit: 255
    t.string "encrypted_credentials_salt", limit: 255
991 992
  end

993 994
  add_index "project_import_data", ["project_id"], name: "index_project_import_data_on_project_id", using: :btree

V
Valery Sizov 已提交
995
  create_table "projects", force: :cascade do |t|
996 997 998
    t.string "name", limit: 255
    t.string "path", limit: 255
    t.text "description", limit: 65535
999 1000
    t.datetime "created_at"
    t.datetime "updated_at"
1001 1002
    t.integer "creator_id", limit: 4
    t.integer "namespace_id", limit: 4
1003
    t.datetime "last_activity_at"
1004 1005
    t.string "import_url", limit: 255
    t.integer "visibility_level", limit: 4, default: 0, null: false
1006
    t.boolean "archived", default: false, null: false
1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025
    t.string "avatar", limit: 255
    t.string "import_status", limit: 255
    t.float "repository_size", limit: 24, default: 0.0
    t.text "merge_requests_template", limit: 65535
    t.integer "star_count", limit: 4, default: 0, null: false
    t.boolean "merge_requests_rebase_enabled", default: false
    t.string "import_type", limit: 255
    t.string "import_source", limit: 255
    t.integer "approvals_before_merge", limit: 4, default: 0, null: false
    t.boolean "reset_approvals_on_push", default: true
    t.integer "commit_count", limit: 4, default: 0
    t.boolean "merge_requests_ff_only_enabled", default: false
    t.text "issues_template", limit: 65535
    t.boolean "mirror", default: false, null: false
    t.datetime "mirror_last_update_at"
    t.datetime "mirror_last_successful_update_at"
    t.integer "mirror_user_id", limit: 4
    t.text "import_error", limit: 65535
    t.integer "ci_id", limit: 4
1026
    t.boolean "shared_runners_enabled", default: true, null: false
1027 1028
    t.string "runners_token", limit: 255
    t.string "build_coverage_regex", limit: 255
1029
    t.boolean "build_allow_git_fetch", default: true, null: false
1030 1031
    t.integer "build_timeout", limit: 4, default: 3600, null: false
    t.boolean "mirror_trigger_builds", default: false, null: false
1032 1033 1034
    t.boolean "pending_delete", default: false
    t.boolean "public_builds", default: true, null: false
    t.boolean "last_repository_check_failed"
J
Jacob Vosmaer 已提交
1035
    t.datetime "last_repository_check_at"
1036 1037 1038
    t.boolean "container_registry_enabled"
    t.boolean "only_allow_merge_if_build_succeeds", default: false, null: false
    t.boolean "has_external_issue_tracker"
1039
    t.string "repository_storage", limit: 255, default: "default", null: false
1040
    t.boolean "request_access_enabled", default: false, null: false
1041
    t.boolean "has_external_wiki"
1042
    t.boolean "repository_read_only"
1043
    t.boolean "lfs_enabled"
1044 1045 1046
    t.integer "repository_size_limit", limit: 4
    t.text "description_html", limit: 65535
    t.boolean "only_allow_merge_if_all_discussions_are_resolved", default: false, null: false
A
Andrew8xx8 已提交
1047 1048
  end

1049
  add_index "projects", ["ci_id"], name: "index_projects_on_ci_id", using: :btree
1050
  add_index "projects", ["created_at"], name: "index_projects_on_created_at", using: :btree
1051
  add_index "projects", ["creator_id"], name: "index_projects_on_creator_id", using: :btree
D
Dmitriy Zaporozhets 已提交
1052
  add_index "projects", ["last_activity_at"], name: "index_projects_on_last_activity_at", using: :btree
1053
  add_index "projects", ["last_repository_check_failed"], name: "index_projects_on_last_repository_check_failed", using: :btree
D
Dmitriy Zaporozhets 已提交
1054
  add_index "projects", ["namespace_id"], name: "index_projects_on_namespace_id", using: :btree
K
Kamil Trzcinski 已提交
1055
  add_index "projects", ["path"], name: "index_projects_on_path", using: :btree
J
James Lopez 已提交
1056
  add_index "projects", ["pending_delete"], name: "index_projects_on_pending_delete", using: :btree
1057
  add_index "projects", ["runners_token"], name: "index_projects_on_runners_token", using: :btree
1058
  add_index "projects", ["star_count"], name: "index_projects_on_star_count", using: :btree
1059
  add_index "projects", ["visibility_level"], name: "index_projects_on_visibility_level", using: :btree
A
Andrew8xx8 已提交
1060

1061
  create_table "protected_branch_merge_access_levels", force: :cascade do |t|
1062 1063
    t.integer "protected_branch_id", limit: 4, null: false
    t.integer "access_level", limit: 4, default: 40
1064 1065
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
1066 1067
    t.integer "user_id", limit: 4
    t.integer "group_id", limit: 4
1068 1069
  end

1070
  add_index "protected_branch_merge_access_levels", ["group_id"], name: "fk_rails_98f3d044fe", using: :btree
1071
  add_index "protected_branch_merge_access_levels", ["protected_branch_id"], name: "index_protected_branch_merge_access", using: :btree
1072
  add_index "protected_branch_merge_access_levels", ["user_id"], name: "index_protected_branch_merge_access_levels_on_user_id", using: :btree
1073 1074

  create_table "protected_branch_push_access_levels", force: :cascade do |t|
1075 1076
    t.integer "protected_branch_id", limit: 4, null: false
    t.integer "access_level", limit: 4, default: 40
1077 1078
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
1079 1080
    t.integer "user_id", limit: 4
    t.integer "group_id", limit: 4
1081 1082
  end

1083
  add_index "protected_branch_push_access_levels", ["group_id"], name: "fk_rails_7111b68cdb", using: :btree
1084
  add_index "protected_branch_push_access_levels", ["protected_branch_id"], name: "index_protected_branch_push_access", using: :btree
1085
  add_index "protected_branch_push_access_levels", ["user_id"], name: "index_protected_branch_push_access_levels_on_user_id", using: :btree
1086

V
Valery Sizov 已提交
1087
  create_table "protected_branches", force: :cascade do |t|
1088 1089
    t.integer "project_id", limit: 4, null: false
    t.string "name", limit: 255, null: false
1090 1091
    t.datetime "created_at"
    t.datetime "updated_at"
A
Andrew8xx8 已提交
1092 1093
  end

D
Dmitriy Zaporozhets 已提交
1094
  add_index "protected_branches", ["project_id"], name: "index_protected_branches_on_project_id", using: :btree
D
Dmitriy Zaporozhets 已提交
1095

1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113
  create_table "push_rules", force: :cascade do |t|
    t.string "force_push_regex", limit: 255
    t.string "delete_branch_regex", limit: 255
    t.string "commit_message_regex", limit: 255
    t.boolean "deny_delete_tag"
    t.integer "project_id", limit: 4
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string "author_email_regex", limit: 255
    t.boolean "member_check", default: false, null: false
    t.string "file_name_regex", limit: 255
    t.boolean "is_sample", default: false
    t.integer "max_file_size", limit: 4, default: 0, null: false
    t.boolean "prevent_secrets", default: false, null: false
  end

  add_index "push_rules", ["project_id"], name: "index_push_rules_on_project_id", using: :btree

V
Valery Sizov 已提交
1114
  create_table "releases", force: :cascade do |t|
1115 1116 1117
    t.string "tag", limit: 255
    t.text "description", limit: 65535
    t.integer "project_id", limit: 4
D
Dmitriy Zaporozhets 已提交
1118 1119
    t.datetime "created_at"
    t.datetime "updated_at"
1120
    t.text "description_html", limit: 65535
D
Dmitriy Zaporozhets 已提交
1121 1122 1123 1124 1125
  end

  add_index "releases", ["project_id", "tag"], name: "index_releases_on_project_id_and_tag", using: :btree
  add_index "releases", ["project_id"], name: "index_releases_on_project_id", using: :btree

1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142
  create_table "remote_mirrors", force: :cascade do |t|
    t.integer "project_id", limit: 4
    t.string "url", limit: 255
    t.boolean "enabled", default: false
    t.string "update_status", limit: 255
    t.datetime "last_update_at"
    t.datetime "last_successful_update_at"
    t.string "last_error", limit: 255
    t.text "encrypted_credentials", limit: 65535
    t.string "encrypted_credentials_iv", limit: 255
    t.string "encrypted_credentials_salt", limit: 255
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
  end

  add_index "remote_mirrors", ["project_id"], name: "index_remote_mirrors_on_project_id", using: :btree

V
Valery Sizov 已提交
1143
  create_table "sent_notifications", force: :cascade do |t|
1144 1145 1146 1147 1148 1149 1150 1151 1152
    t.integer "project_id", limit: 4
    t.integer "noteable_id", limit: 4
    t.string "noteable_type", limit: 255
    t.integer "recipient_id", limit: 4
    t.string "commit_id", limit: 255
    t.string "reply_key", limit: 255, null: false
    t.string "line_code", limit: 255
    t.string "note_type", limit: 255
    t.text "position", limit: 65535
D
Douwe Maan 已提交
1153 1154 1155 1156
  end

  add_index "sent_notifications", ["reply_key"], name: "index_sent_notifications_on_reply_key", unique: true, using: :btree

V
Valery Sizov 已提交
1157
  create_table "services", force: :cascade do |t|
1158 1159 1160
    t.string "type", limit: 255
    t.string "title", limit: 255
    t.integer "project_id", limit: 4
1161 1162
    t.datetime "created_at"
    t.datetime "updated_at"
1163
    t.boolean "active", default: false, null: false
1164
    t.text "properties", limit: 65535
1165 1166 1167 1168 1169 1170 1171
    t.boolean "template", default: false
    t.boolean "push_events", default: true
    t.boolean "issues_events", default: true
    t.boolean "merge_requests_events", default: true
    t.boolean "tag_push_events", default: true
    t.boolean "note_events", default: true, null: false
    t.boolean "build_events", default: false, null: false
1172
    t.string "category", limit: 255, default: "common", null: false
1173 1174 1175 1176
    t.boolean "default", default: false
    t.boolean "wiki_page_events", default: true
    t.boolean "pipeline_events", default: false, null: false
    t.boolean "confidential_issues_events", default: true, null: false
1177 1178
  end

D
Dmitriy Zaporozhets 已提交
1179
  add_index "services", ["project_id"], name: "index_services_on_project_id", using: :btree
Y
Yorick Peterse 已提交
1180
  add_index "services", ["template"], name: "index_services_on_template", using: :btree
A
Andrew8xx8 已提交
1181

V
Valery Sizov 已提交
1182
  create_table "snippets", force: :cascade do |t|
1183 1184 1185 1186
    t.string "title", limit: 255
    t.text "content", limit: 4294967295
    t.integer "author_id", limit: 4, null: false
    t.integer "project_id", limit: 4
1187 1188
    t.datetime "created_at"
    t.datetime "updated_at"
1189 1190 1191 1192 1193
    t.string "file_name", limit: 255
    t.string "type", limit: 255
    t.integer "visibility_level", limit: 4, default: 0, null: false
    t.text "title_html", limit: 65535
    t.text "content_html", limit: 65535
A
Andrew8xx8 已提交
1194 1195
  end

D
Dmitriy Zaporozhets 已提交
1196 1197
  add_index "snippets", ["author_id"], name: "index_snippets_on_author_id", using: :btree
  add_index "snippets", ["project_id"], name: "index_snippets_on_project_id", using: :btree
1198
  add_index "snippets", ["updated_at"], name: "index_snippets_on_updated_at", using: :btree
V
Valery Sizov 已提交
1199
  add_index "snippets", ["visibility_level"], name: "index_snippets_on_visibility_level", using: :btree
A
Andrew8xx8 已提交
1200

1201
  create_table "spam_logs", force: :cascade do |t|
1202 1203 1204
    t.integer "user_id", limit: 4
    t.string "source_ip", limit: 255
    t.string "user_agent", limit: 255
1205
    t.boolean "via_api"
1206 1207 1208
    t.string "noteable_type", limit: 255
    t.string "title", limit: 255
    t.text "description", limit: 65535
1209 1210 1211
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
    t.boolean "submitted_as_ham", default: false, null: false
1212 1213
  end

V
Valery Sizov 已提交
1214
  create_table "subscriptions", force: :cascade do |t|
1215 1216 1217
    t.integer "user_id", limit: 4
    t.integer "subscribable_id", limit: 4
    t.string "subscribable_type", limit: 255
1218
    t.boolean "subscribed"
V
Valery Sizov 已提交
1219 1220 1221 1222
    t.datetime "created_at"
    t.datetime "updated_at"
  end

1223
  add_index "subscriptions", ["subscribable_id", "subscribable_type", "user_id"], name: "subscriptions_user_id_and_ref_fields", unique: true, using: :btree
V
Valery Sizov 已提交
1224

V
Valery Sizov 已提交
1225
  create_table "taggings", force: :cascade do |t|
1226 1227 1228 1229 1230 1231
    t.integer "tag_id", limit: 4
    t.integer "taggable_id", limit: 4
    t.string "taggable_type", limit: 255
    t.integer "tagger_id", limit: 4
    t.string "tagger_type", limit: 255
    t.string "context", limit: 255
A
Andrew8xx8 已提交
1232 1233 1234
    t.datetime "created_at"
  end

1235
  add_index "taggings", ["tag_id", "taggable_id", "taggable_type", "context", "tagger_id", "tagger_type"], name: "taggings_idx", unique: true, using: :btree
1236 1237
  add_index "taggings", ["taggable_id", "taggable_type", "context"], name: "index_taggings_on_taggable_id_and_taggable_type_and_context", using: :btree

V
Valery Sizov 已提交
1238
  create_table "tags", force: :cascade do |t|
1239 1240
    t.string "name", limit: 255
    t.integer "taggings_count", limit: 4, default: 0
A
Andrew8xx8 已提交
1241 1242
  end

1243 1244
  add_index "tags", ["name"], name: "index_tags_on_name", unique: true, using: :btree

1245
  create_table "todos", force: :cascade do |t|
1246 1247 1248 1249 1250 1251 1252
    t.integer "user_id", limit: 4, null: false
    t.integer "project_id", limit: 4, null: false
    t.integer "target_id", limit: 4
    t.string "target_type", limit: 255, null: false
    t.integer "author_id", limit: 4
    t.integer "action", limit: 4, null: false
    t.string "state", limit: 255, null: false
D
Douglas Barbosa Alexandre 已提交
1253 1254
    t.datetime "created_at"
    t.datetime "updated_at"
1255 1256
    t.integer "note_id", limit: 4
    t.string "commit_id", limit: 255
D
Douglas Barbosa Alexandre 已提交
1257 1258
  end

1259
  add_index "todos", ["author_id"], name: "index_todos_on_author_id", using: :btree
J
James Lopez 已提交
1260
  add_index "todos", ["commit_id"], name: "index_todos_on_commit_id", using: :btree
1261 1262 1263 1264
  add_index "todos", ["note_id"], name: "index_todos_on_note_id", using: :btree
  add_index "todos", ["project_id"], name: "index_todos_on_project_id", using: :btree
  add_index "todos", ["target_type", "target_id"], name: "index_todos_on_target_type_and_target_id", using: :btree
  add_index "todos", ["user_id"], name: "index_todos_on_user_id", using: :btree
D
Douglas Barbosa Alexandre 已提交
1265

Y
Yorick Peterse 已提交
1266
  create_table "trending_projects", force: :cascade do |t|
1267
    t.integer "project_id", limit: 4, null: false
Y
Yorick Peterse 已提交
1268 1269 1270 1271
  end

  add_index "trending_projects", ["project_id"], name: "index_trending_projects_on_project_id", using: :btree

1272
  create_table "u2f_registrations", force: :cascade do |t|
1273 1274 1275 1276 1277
    t.text "certificate", limit: 65535
    t.string "key_handle", limit: 255
    t.string "public_key", limit: 255
    t.integer "counter", limit: 4
    t.integer "user_id", limit: 4
1278 1279
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
1280
    t.string "name", limit: 255
1281 1282 1283 1284 1285
  end

  add_index "u2f_registrations", ["key_handle"], name: "index_u2f_registrations_on_key_handle", using: :btree
  add_index "u2f_registrations", ["user_id"], name: "index_u2f_registrations_on_user_id", using: :btree

1286 1287 1288 1289 1290 1291 1292
  create_table "user_activities", force: :cascade do |t|
    t.integer "user_id", limit: 4
    t.datetime "last_activity_at", null: false
  end

  add_index "user_activities", ["user_id"], name: "index_user_activities_on_user_id", unique: true, using: :btree

1293
  create_table "user_agent_details", force: :cascade do |t|
1294 1295 1296 1297
    t.string "user_agent", limit: 255, null: false
    t.string "ip_address", limit: 255, null: false
    t.integer "subject_id", limit: 4, null: false
    t.string "subject_type", limit: 255, null: false
1298 1299 1300
    t.boolean "submitted", default: false, null: false
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
1301 1302
  end

V
Valery Sizov 已提交
1303
  create_table "users", force: :cascade do |t|
1304 1305 1306
    t.string "email", limit: 255, default: "", null: false
    t.string "encrypted_password", limit: 255, default: "", null: false
    t.string "reset_password_token", limit: 255
A
Andrew8xx8 已提交
1307 1308
    t.datetime "reset_password_sent_at"
    t.datetime "remember_created_at"
1309
    t.integer "sign_in_count", limit: 4, default: 0
A
Andrew8xx8 已提交
1310 1311
    t.datetime "current_sign_in_at"
    t.datetime "last_sign_in_at"
1312 1313
    t.string "current_sign_in_ip", limit: 255
    t.string "last_sign_in_ip", limit: 255
1314 1315
    t.datetime "created_at"
    t.datetime "updated_at"
1316
    t.string "name", limit: 255
1317
    t.boolean "admin", default: false, null: false
1318 1319 1320 1321 1322 1323 1324 1325
    t.integer "projects_limit", limit: 4, default: 10
    t.string "skype", limit: 255, default: "", null: false
    t.string "linkedin", limit: 255, default: "", null: false
    t.string "twitter", limit: 255, default: "", null: false
    t.string "authentication_token", limit: 255
    t.integer "theme_id", limit: 4, default: 1, null: false
    t.string "bio", limit: 255
    t.integer "failed_attempts", limit: 4, default: 0
A
Andrew8xx8 已提交
1326
    t.datetime "locked_at"
1327
    t.string "username", limit: 255
1328 1329
    t.boolean "can_create_group", default: true, null: false
    t.boolean "can_create_team", default: true, null: false
1330 1331
    t.string "state", limit: 255
    t.integer "color_scheme_id", limit: 4, default: 1, null: false
1332
    t.datetime "password_expires_at"
1333
    t.integer "created_by_id", limit: 4
1334
    t.datetime "last_credential_check_at"
1335 1336
    t.string "avatar", limit: 255
    t.string "confirmation_token", limit: 255
1337 1338
    t.datetime "confirmed_at"
    t.datetime "confirmation_sent_at"
1339
    t.string "unconfirmed_email", limit: 255
1340
    t.boolean "hide_no_ssh_key", default: false
1341 1342 1343
    t.string "website_url", limit: 255, default: "", null: false
    t.datetime "admin_email_unsubscribed_at"
    t.string "notification_email", limit: 255
1344 1345
    t.boolean "hide_no_password", default: false
    t.boolean "password_automatically_set", default: false
1346 1347 1348 1349
    t.string "location", limit: 255
    t.string "encrypted_otp_secret", limit: 255
    t.string "encrypted_otp_secret_iv", limit: 255
    t.string "encrypted_otp_secret_salt", limit: 255
1350
    t.boolean "otp_required_for_login", default: false, null: false
1351 1352 1353 1354 1355 1356
    t.text "otp_backup_codes", limit: 65535
    t.string "public_email", limit: 255, default: "", null: false
    t.integer "dashboard", limit: 4, default: 0
    t.integer "project_view", limit: 4, default: 0
    t.integer "consumed_timestep", limit: 4
    t.integer "layout", limit: 4, default: 0
1357
    t.boolean "hide_project_limit", default: false
1358 1359
    t.text "note", limit: 65535
    t.string "unlock_token", limit: 255
G
Gabriel Mazetto 已提交
1360
    t.datetime "otp_grace_period_started_at"
1361 1362
    t.boolean "ldap_email", default: false, null: false
    t.boolean "external", default: false
1363 1364
    t.string "organization", limit: 255
    t.string "incoming_email_token", limit: 255
A
Andrew8xx8 已提交
1365 1366
  end

D
Dmitriy Zaporozhets 已提交
1367 1368 1369
  add_index "users", ["admin"], name: "index_users_on_admin", using: :btree
  add_index "users", ["authentication_token"], name: "index_users_on_authentication_token", unique: true, using: :btree
  add_index "users", ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true, using: :btree
1370
  add_index "users", ["created_at"], name: "index_users_on_created_at", using: :btree
G
GitLab 已提交
1371
  add_index "users", ["current_sign_in_at"], name: "index_users_on_current_sign_in_at", using: :btree
D
Dmitriy Zaporozhets 已提交
1372
  add_index "users", ["email"], name: "index_users_on_email", unique: true, using: :btree
1373
  add_index "users", ["incoming_email_token"], name: "index_users_on_incoming_email_token", using: :btree
D
Dmitriy Zaporozhets 已提交
1374 1375
  add_index "users", ["name"], name: "index_users_on_name", using: :btree
  add_index "users", ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true, using: :btree
S
Stan Hu 已提交
1376
  add_index "users", ["state"], name: "index_users_on_state", using: :btree
D
Dmitriy Zaporozhets 已提交
1377 1378
  add_index "users", ["username"], name: "index_users_on_username", using: :btree

V
Valery Sizov 已提交
1379
  create_table "users_star_projects", force: :cascade do |t|
1380 1381
    t.integer "project_id", limit: 4, null: false
    t.integer "user_id", limit: 4, null: false
C
Ciro Santilli 已提交
1382 1383 1384 1385 1386 1387 1388 1389
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "users_star_projects", ["project_id"], name: "index_users_star_projects_on_project_id", using: :btree
  add_index "users_star_projects", ["user_id", "project_id"], name: "index_users_star_projects_on_user_id_and_project_id", unique: true, using: :btree
  add_index "users_star_projects", ["user_id"], name: "index_users_star_projects_on_user_id", using: :btree

V
Valery Sizov 已提交
1390
  create_table "web_hooks", force: :cascade do |t|
1391
    t.string "url", limit: 2000
1392
    t.integer "project_id", limit: 4
1393 1394
    t.datetime "created_at"
    t.datetime "updated_at"
1395 1396
    t.string "type", limit: 255, default: "ProjectHook"
    t.integer "service_id", limit: 4
1397 1398 1399 1400
    t.boolean "push_events", default: true, null: false
    t.boolean "issues_events", default: false, null: false
    t.boolean "merge_requests_events", default: false, null: false
    t.boolean "tag_push_events", default: false
1401
    t.integer "group_id", limit: 4
1402 1403 1404
    t.boolean "note_events", default: false, null: false
    t.boolean "enable_ssl_verification", default: true
    t.boolean "build_events", default: false, null: false
1405
    t.string "token", limit: 255
1406 1407 1408
    t.boolean "wiki_page_events", default: false, null: false
    t.boolean "pipeline_events", default: false, null: false
    t.boolean "confidential_issues_events", default: false, null: false
A
Andrew8xx8 已提交
1409 1410
  end

D
Dmitriy Zaporozhets 已提交
1411
  add_index "web_hooks", ["project_id"], name: "index_web_hooks_on_project_id", using: :btree
D
Dmitriy Zaporozhets 已提交
1412

1413
  add_foreign_key "approver_groups", "namespaces", column: "group_id", on_delete: :cascade
D
Douglas Barbosa Alexandre 已提交
1414
  add_foreign_key "boards", "projects"
T
Timothy Andrew 已提交
1415
  add_foreign_key "issue_metrics", "issues", on_delete: :cascade
1416 1417
  add_foreign_key "label_priorities", "labels", on_delete: :cascade
  add_foreign_key "label_priorities", "projects", on_delete: :cascade
D
Douglas Barbosa Alexandre 已提交
1418
  add_foreign_key "labels", "namespaces", column: "group_id", on_delete: :cascade
D
Douglas Barbosa Alexandre 已提交
1419 1420
  add_foreign_key "lists", "boards"
  add_foreign_key "lists", "labels"
1421
  add_foreign_key "merge_request_metrics", "ci_commits", column: "pipeline_id", on_delete: :cascade
T
Timothy Andrew 已提交
1422 1423 1424
  add_foreign_key "merge_request_metrics", "merge_requests", on_delete: :cascade
  add_foreign_key "merge_requests_closing_issues", "issues", on_delete: :cascade
  add_foreign_key "merge_requests_closing_issues", "merge_requests", on_delete: :cascade
1425 1426
  add_foreign_key "path_locks", "projects"
  add_foreign_key "path_locks", "users"
1427
  add_foreign_key "personal_access_tokens", "users"
1428
  add_foreign_key "protected_branch_merge_access_levels", "namespaces", column: "group_id"
1429
  add_foreign_key "protected_branch_merge_access_levels", "protected_branches"
1430 1431
  add_foreign_key "protected_branch_merge_access_levels", "users"
  add_foreign_key "protected_branch_push_access_levels", "namespaces", column: "group_id"
1432
  add_foreign_key "protected_branch_push_access_levels", "protected_branches"
1433 1434
  add_foreign_key "protected_branch_push_access_levels", "users"
  add_foreign_key "remote_mirrors", "projects"
Y
Yorick Peterse 已提交
1435
  add_foreign_key "trending_projects", "projects", on_delete: :cascade
1436
  add_foreign_key "u2f_registrations", "users"
1437
  add_foreign_key "user_activities", "users", on_delete: :cascade
1438
end