diff --git a/app/models/appearance.rb b/app/models/appearance.rb
index 4cf8dd9a8ce2f3b4d5519eb4646d347004a808fc..4528760fefabdf79ff365fca8fdc77eb11021155 100644
--- a/app/models/appearance.rb
+++ b/app/models/appearance.rb
@@ -1,3 +1,16 @@
+# == Schema Information
+#
+# Table name: appearances
+#
+#  id          :integer          not null, primary key
+#  title       :string
+#  description :text
+#  header_logo :string
+#  logo        :string
+#  created_at  :datetime         not null
+#  updated_at  :datetime         not null
+#
+
 class Appearance < ActiveRecord::Base
   validates :title,       presence: true
   validates :description, presence: true
diff --git a/app/models/application_setting.rb b/app/models/application_setting.rb
index 36f88154232319605450d3b84beac6878c3e8210..72ec91d29092d4041be14b017df6469d400ea5c3 100644
--- a/app/models/application_setting.rb
+++ b/app/models/application_setting.rb
@@ -10,21 +10,20 @@
 #  sign_in_text                      :text
 #  created_at                        :datetime
 #  updated_at                        :datetime
-#  home_page_url                     :string(255)
+#  home_page_url                     :string
 #  default_branch_protection         :integer          default(2)
 #  restricted_visibility_levels      :text
 #  version_check_enabled             :boolean          default(TRUE)
 #  max_attachment_size               :integer          default(10), not null
 #  default_project_visibility        :integer
 #  default_snippet_visibility        :integer
-#  default_group_visibility          :integer
 #  restricted_signup_domains         :text
 #  user_oauth_applications           :boolean          default(TRUE)
-#  after_sign_out_path               :string(255)
+#  after_sign_out_path               :string
 #  session_expire_delay              :integer          default(10080), not null
 #  import_sources                    :text
 #  help_page_text                    :text
-#  admin_notification_email          :string(255)
+#  admin_notification_email          :string
 #  shared_runners_enabled            :boolean          default(TRUE), not null
 #  max_artifacts_size                :integer          default(100), not null
 #  runners_registration_token        :string
@@ -32,8 +31,6 @@
 #  two_factor_grace_period           :integer          default(48)
 #  metrics_enabled                   :boolean          default(FALSE)
 #  metrics_host                      :string           default("localhost")
-#  metrics_username                  :string
-#  metrics_password                  :string
 #  metrics_pool_size                 :integer          default(16)
 #  metrics_timeout                   :integer          default(10)
 #  metrics_method_call_threshold     :integer          default(10)
@@ -41,9 +38,16 @@
 #  recaptcha_site_key                :string
 #  recaptcha_private_key             :string
 #  metrics_port                      :integer          default(8089)
+#  metrics_sample_interval           :integer          default(15)
 #  sentry_enabled                    :boolean          default(FALSE)
 #  sentry_dsn                        :string
+#  akismet_enabled                   :boolean          default(FALSE)
+#  akismet_api_key                   :string
 #  email_author_in_body              :boolean          default(FALSE)
+#  default_group_visibility          :integer
+#  repository_checks_enabled         :boolean          default(FALSE)
+#  metrics_packet_size               :integer          default(1)
+#  shared_runners_text               :text
 #
 
 class ApplicationSetting < ActiveRecord::Base
diff --git a/app/models/audit_event.rb b/app/models/audit_event.rb
index 0ed0dd98a5950437930ea3f5c64fd2079b615cb4..44b090260e755a6546154c21542b9fa6bf0b429c 100644
--- a/app/models/audit_event.rb
+++ b/app/models/audit_event.rb
@@ -4,9 +4,9 @@
 #
 #  id          :integer          not null, primary key
 #  author_id   :integer          not null
-#  type        :string(255)      not null
+#  type        :string           not null
 #  entity_id   :integer          not null
-#  entity_type :string(255)      not null
+#  entity_type :string           not null
 #  details     :text
 #  created_at  :datetime
 #  updated_at  :datetime
diff --git a/app/models/broadcast_message.rb b/app/models/broadcast_message.rb
index 8a0a8a4c2a9b846936574a68e5e7c12835169714..075ac733bfcccdf67587cbff72195da5069f4997 100644
--- a/app/models/broadcast_message.rb
+++ b/app/models/broadcast_message.rb
@@ -8,8 +8,8 @@
 #  ends_at    :datetime
 #  created_at :datetime
 #  updated_at :datetime
-#  color      :string(255)
-#  font       :string(255)
+#  color      :string
+#  font       :string
 #
 
 class BroadcastMessage < ActiveRecord::Base
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb
index 553cd44797193ef7a8d8238f2a53a30afb9f2bb1..4bc3a225e2c5d26e3dac0ef16c1a1f7f75ae02d3 100644
--- a/app/models/ci/build.rb
+++ b/app/models/ci/build.rb
@@ -4,7 +4,7 @@
 #
 #  id                 :integer          not null, primary key
 #  project_id         :integer
-#  status             :string(255)
+#  status             :string
 #  finished_at        :datetime
 #  trace              :text
 #  created_at         :datetime
@@ -15,19 +15,19 @@
 #  commit_id          :integer
 #  commands           :text
 #  job_id             :integer
-#  name               :string(255)
+#  name               :string
 #  deploy             :boolean          default(FALSE)
 #  options            :text
 #  allow_failure      :boolean          default(FALSE), not null
-#  stage              :string(255)
+#  stage              :string
 #  trigger_request_id :integer
 #  stage_idx          :integer
 #  tag                :boolean
-#  ref                :string(255)
+#  ref                :string
 #  user_id            :integer
-#  type               :string(255)
-#  target_url         :string(255)
-#  description        :string(255)
+#  type               :string
+#  target_url         :string
+#  description        :string
 #  artifacts_file     :text
 #  gl_project_id      :integer
 #  artifacts_metadata :text
diff --git a/app/models/ci/commit.rb b/app/models/ci/commit.rb
index f2667e5476b7896d66fede910ddf1ad83f844914..4ac4e0fb8b2250827685b556f68b02e19953ca46 100644
--- a/app/models/ci/commit.rb
+++ b/app/models/ci/commit.rb
@@ -4,9 +4,9 @@
 #
 #  id            :integer          not null, primary key
 #  project_id    :integer
-#  ref           :string(255)
-#  sha           :string(255)
-#  before_sha    :string(255)
+#  ref           :string
+#  sha           :string
+#  before_sha    :string
 #  push_data     :text
 #  created_at    :datetime
 #  updated_at    :datetime
@@ -14,6 +14,10 @@
 #  yaml_errors   :text
 #  committed_at  :datetime
 #  gl_project_id :integer
+#  status        :string
+#  started_at    :datetime
+#  finished_at   :datetime
+#  duration      :integer
 #
 
 module Ci
diff --git a/app/models/ci/runner.rb b/app/models/ci/runner.rb
index 90349a07594966e60529a79aa37647eb837ab6a2..add59a08892f7dc34306885c19f0bd5da22b507d 100644
--- a/app/models/ci/runner.rb
+++ b/app/models/ci/runner.rb
@@ -3,18 +3,18 @@
 # Table name: ci_runners
 #
 #  id           :integer          not null, primary key
-#  token        :string(255)
+#  token        :string
 #  created_at   :datetime
 #  updated_at   :datetime
-#  description  :string(255)
+#  description  :string
 #  contacted_at :datetime
 #  active       :boolean          default(TRUE), not null
 #  is_shared    :boolean          default(FALSE)
-#  name         :string(255)
-#  version      :string(255)
-#  revision     :string(255)
-#  platform     :string(255)
-#  architecture :string(255)
+#  name         :string
+#  version      :string
+#  revision     :string
+#  platform     :string
+#  architecture :string
 #
 
 module Ci
diff --git a/app/models/ci/trigger.rb b/app/models/ci/trigger.rb
index 2b9a457c8ab6f32235d5f661056682c14d9089c3..4f3f4d79fac836537b5543b19b40853b134fb964 100644
--- a/app/models/ci/trigger.rb
+++ b/app/models/ci/trigger.rb
@@ -3,7 +3,7 @@
 # Table name: ci_triggers
 #
 #  id            :integer          not null, primary key
-#  token         :string(255)
+#  token         :string
 #  project_id    :integer
 #  deleted_at    :datetime
 #  created_at    :datetime
diff --git a/app/models/ci/variable.rb b/app/models/ci/variable.rb
index e786bd7dd93c99f9cb4ddc0a588f2c9b0a9d1856..4229fe085a15875c78318a0f336314463e54c565 100644
--- a/app/models/ci/variable.rb
+++ b/app/models/ci/variable.rb
@@ -4,11 +4,11 @@
 #
 #  id                   :integer          not null, primary key
 #  project_id           :integer
-#  key                  :string(255)
+#  key                  :string
 #  value                :text
 #  encrypted_value      :text
-#  encrypted_value_salt :string(255)
-#  encrypted_value_iv   :string(255)
+#  encrypted_value_salt :string
+#  encrypted_value_iv   :string
 #  gl_project_id        :integer
 #
 
diff --git a/app/models/commit_status.rb b/app/models/commit_status.rb
index aa56314aa164a03886d55fa93dbc3e8cf27117fc..1260c448de3533420d18798373bab04e0e3077f4 100644
--- a/app/models/commit_status.rb
+++ b/app/models/commit_status.rb
@@ -4,7 +4,7 @@
 #
 #  id                 :integer          not null, primary key
 #  project_id         :integer
-#  status             :string(255)
+#  status             :string
 #  finished_at        :datetime
 #  trace              :text
 #  created_at         :datetime
@@ -15,21 +15,24 @@
 #  commit_id          :integer
 #  commands           :text
 #  job_id             :integer
-#  name               :string(255)
+#  name               :string
 #  deploy             :boolean          default(FALSE)
 #  options            :text
 #  allow_failure      :boolean          default(FALSE), not null
-#  stage              :string(255)
+#  stage              :string
 #  trigger_request_id :integer
 #  stage_idx          :integer
 #  tag                :boolean
-#  ref                :string(255)
+#  ref                :string
 #  user_id            :integer
-#  type               :string(255)
-#  target_url         :string(255)
-#  description        :string(255)
+#  type               :string
+#  target_url         :string
+#  description        :string
 #  artifacts_file     :text
 #  gl_project_id      :integer
+#  artifacts_metadata :text
+#  erased_by_id       :integer
+#  erased_at          :datetime
 #
 
 class CommitStatus < ActiveRecord::Base
diff --git a/app/models/deploy_key.rb b/app/models/deploy_key.rb
index 9ab663c04ad926be03cf412eed596472f0885d5b..43cf625f770aaf901c9d1421e20c1dd3df4a2c0b 100644
--- a/app/models/deploy_key.rb
+++ b/app/models/deploy_key.rb
@@ -7,9 +7,9 @@
 #  created_at  :datetime
 #  updated_at  :datetime
 #  key         :text
-#  title       :string(255)
-#  type        :string(255)
-#  fingerprint :string(255)
+#  title       :string
+#  type        :string
+#  fingerprint :string
 #  public      :boolean          default(FALSE), not null
 #
 
diff --git a/app/models/email.rb b/app/models/email.rb
index b323d1edd100c53d8fb58a838732959c8396ba63..eae2472f33765260923d57b7791f0b282d859e49 100644
--- a/app/models/email.rb
+++ b/app/models/email.rb
@@ -4,7 +4,7 @@
 #
 #  id         :integer          not null, primary key
 #  user_id    :integer          not null
-#  email      :string(255)      not null
+#  email      :string           not null
 #  created_at :datetime
 #  updated_at :datetime
 #
diff --git a/app/models/event.rb b/app/models/event.rb
index 897518aadc773b4fab1ca8793ebdc8a324a61997..25c7c3e6dc7814051c4d289a2b20794dd57f4e08 100644
--- a/app/models/event.rb
+++ b/app/models/event.rb
@@ -3,9 +3,9 @@
 # Table name: events
 #
 #  id          :integer          not null, primary key
-#  target_type :string(255)
+#  target_type :string
 #  target_id   :integer
-#  title       :string(255)
+#  title       :string
 #  data        :text
 #  project_id  :integer
 #  created_at  :datetime
diff --git a/app/models/generic_commit_status.rb b/app/models/generic_commit_status.rb
index 97f4f03a9a546fb9ec15c84dc46b97bee3947756..d4afd8cbe84085d5e61107de693e2e17f93f7a74 100644
--- a/app/models/generic_commit_status.rb
+++ b/app/models/generic_commit_status.rb
@@ -4,7 +4,7 @@
 #
 #  id                 :integer          not null, primary key
 #  project_id         :integer
-#  status             :string(255)
+#  status             :string
 #  finished_at        :datetime
 #  trace              :text
 #  created_at         :datetime
@@ -15,21 +15,24 @@
 #  commit_id          :integer
 #  commands           :text
 #  job_id             :integer
-#  name               :string(255)
+#  name               :string
 #  deploy             :boolean          default(FALSE)
 #  options            :text
 #  allow_failure      :boolean          default(FALSE), not null
-#  stage              :string(255)
+#  stage              :string
 #  trigger_request_id :integer
 #  stage_idx          :integer
 #  tag                :boolean
-#  ref                :string(255)
+#  ref                :string
 #  user_id            :integer
-#  type               :string(255)
-#  target_url         :string(255)
-#  description        :string(255)
+#  type               :string
+#  target_url         :string
+#  description        :string
 #  artifacts_file     :text
 #  gl_project_id      :integer
+#  artifacts_metadata :text
+#  erased_by_id       :integer
+#  erased_at          :datetime
 #
 
 class GenericCommitStatus < CommitStatus
diff --git a/app/models/group.rb b/app/models/group.rb
index 1f8432e3320222e0904c5780fb963d0738680ab8..cff76877958f6ceb971ea383893a43673a9348c5 100644
--- a/app/models/group.rb
+++ b/app/models/group.rb
@@ -2,16 +2,17 @@
 #
 # Table name: namespaces
 #
-#  id                     :integer          not null, primary key
-#  name                   :string(255)      not null
-#  path                   :string(255)      not null
-#  owner_id               :integer
-#  visibility_level       :integer          default(20), not null
-#  created_at             :datetime
-#  updated_at             :datetime
-#  type                   :string(255)
-#  description            :string(255)      default(""), not null
-#  avatar                 :string(255)
+#  id                    :integer          not null, primary key
+#  name                  :string           not null
+#  path                  :string           not null
+#  owner_id              :integer
+#  created_at            :datetime
+#  updated_at            :datetime
+#  type                  :string
+#  description           :string           default(""), not null
+#  avatar                :string
+#  share_with_group_lock :boolean          default(FALSE)
+#  visibility_level      :integer          default(20), not null
 #
 
 require 'carrierwave/orm/activerecord'
diff --git a/app/models/hooks/project_hook.rb b/app/models/hooks/project_hook.rb
index d149511b868f3fd9a17ea960867e0c23ed7c1108..64f570b12aeddb3d1fd9037f52540531ec39580f 100644
--- a/app/models/hooks/project_hook.rb
+++ b/app/models/hooks/project_hook.rb
@@ -16,7 +16,7 @@
 #  note_events             :boolean          default(FALSE), not null
 #  enable_ssl_verification :boolean          default(TRUE)
 #  build_events            :boolean          default(FALSE), not null
-#  token                   :string
+#  wiki_page_events        :boolean          default(FALSE), not null
 #
 
 class ProjectHook < WebHook
diff --git a/app/models/hooks/service_hook.rb b/app/models/hooks/service_hook.rb
index f45145eeb3a8833c3f8e5a1f640d60a53a536005..23f6468ee52abe7d2c7775e59a59776e514383e6 100644
--- a/app/models/hooks/service_hook.rb
+++ b/app/models/hooks/service_hook.rb
@@ -16,7 +16,7 @@
 #  note_events             :boolean          default(FALSE), not null
 #  enable_ssl_verification :boolean          default(TRUE)
 #  build_events            :boolean          default(FALSE), not null
-#  token                   :string
+#  wiki_page_events        :boolean          default(FALSE), not null
 #
 
 class ServiceHook < WebHook
diff --git a/app/models/hooks/system_hook.rb b/app/models/hooks/system_hook.rb
index 012cc8ec0058f1b6e7bfdf17bf976aa1c66be897..5e9046f362314b9553a8320b7b321ae23f06fcb1 100644
--- a/app/models/hooks/system_hook.rb
+++ b/app/models/hooks/system_hook.rb
@@ -16,7 +16,7 @@
 #  note_events             :boolean          default(FALSE), not null
 #  enable_ssl_verification :boolean          default(TRUE)
 #  build_events            :boolean          default(FALSE), not null
-#  token                   :string
+#  wiki_page_events        :boolean          default(FALSE), not null
 #
 
 class SystemHook < WebHook
diff --git a/app/models/hooks/web_hook.rb b/app/models/hooks/web_hook.rb
index 1e3b48155967a8fbdec06d025011f4fb0b20fbf5..a8f17ac16a63c09f6f4e5f40ea36e4d844e14622 100644
--- a/app/models/hooks/web_hook.rb
+++ b/app/models/hooks/web_hook.rb
@@ -16,7 +16,7 @@
 #  note_events             :boolean          default(FALSE), not null
 #  enable_ssl_verification :boolean          default(TRUE)
 #  build_events            :boolean          default(FALSE), not null
-#  token                   :string
+#  wiki_page_events        :boolean          default(FALSE), not null
 #
 
 class WebHook < ActiveRecord::Base
diff --git a/app/models/identity.rb b/app/models/identity.rb
index e1915b079d439d5c954ab04a33f5474700b3aa3d..ef4d5f99091bf16d622ed8e516d5fa142fc2e8ff 100644
--- a/app/models/identity.rb
+++ b/app/models/identity.rb
@@ -3,8 +3,8 @@
 # Table name: identities
 #
 #  id         :integer          not null, primary key
-#  extern_uid :string(255)
-#  provider   :string(255)
+#  extern_uid :string
+#  provider   :string
 #  user_id    :integer
 #  created_at :datetime
 #  updated_at :datetime
diff --git a/app/models/issue.rb b/app/models/issue.rb
index ea1bfb776ee26fec7d58044373e916d9c7154dca..abaa509707c15d0f81ff3f7cd4b4a20c717fbc7a 100644
--- a/app/models/issue.rb
+++ b/app/models/issue.rb
@@ -3,20 +3,23 @@
 # Table name: issues
 #
 #  id            :integer          not null, primary key
-#  title         :string(255)
+#  title         :string
 #  assignee_id   :integer
 #  author_id     :integer
 #  project_id    :integer
 #  created_at    :datetime
 #  updated_at    :datetime
 #  position      :integer          default(0)
-#  branch_name   :string(255)
+#  branch_name   :string
 #  description   :text
 #  milestone_id  :integer
-#  state         :string(255)
+#  state         :string
 #  iid           :integer
 #  updated_by_id :integer
 #  moved_to_id   :integer
+#  confidential  :boolean          default(FALSE)
+#  deleted_at    :datetime
+#  due_date      :date
 #
 
 require 'carrierwave/orm/activerecord'
diff --git a/app/models/key.rb b/app/models/key.rb
index 0282ad1813915ee14d7740ba8ef337f9a5c003cc..b2b57849f8a55a46c1a71ba536e9e268309a9ceb 100644
--- a/app/models/key.rb
+++ b/app/models/key.rb
@@ -7,9 +7,9 @@
 #  created_at  :datetime
 #  updated_at  :datetime
 #  key         :text
-#  title       :string(255)
-#  type        :string(255)
-#  fingerprint :string(255)
+#  title       :string
+#  type        :string
+#  fingerprint :string
 #  public      :boolean          default(FALSE), not null
 #
 
diff --git a/app/models/label.rb b/app/models/label.rb
index 60bdce32952ed15791d076cb00dd02b3ce3e98e4..9a22398d9523f4809b178721196f4a97cc13e9f1 100644
--- a/app/models/label.rb
+++ b/app/models/label.rb
@@ -2,14 +2,14 @@
 #
 # Table name: labels
 #
-#  id           :integer          not null, primary key
-#  title        :string(255)
-#  color        :string(255)
-#  project_id   :integer
-#  created_at   :datetime
-#  updated_at   :datetime
-#  template     :boolean          default(FALSE)
-#  description  :string(255)
+#  id          :integer          not null, primary key
+#  title       :string
+#  color       :string
+#  project_id  :integer
+#  created_at  :datetime
+#  updated_at  :datetime
+#  template    :boolean          default(FALSE)
+#  description :string
 #
 
 class Label < ActiveRecord::Base
diff --git a/app/models/label_link.rb b/app/models/label_link.rb
index b94c9c777af3109afe8cb86712063451c2c51dc0..7b8e872b6dd1934f45ea855bdb78df186cc364c3 100644
--- a/app/models/label_link.rb
+++ b/app/models/label_link.rb
@@ -5,7 +5,7 @@
 #  id          :integer          not null, primary key
 #  label_id    :integer
 #  target_id   :integer
-#  target_type :string(255)
+#  target_type :string
 #  created_at  :datetime
 #  updated_at  :datetime
 #
diff --git a/app/models/lfs_object.rb b/app/models/lfs_object.rb
index 86b1b7e2f99839408e84502c5231d0649ef6aae3..927e764af926983edb02151fb8bfaf33351096be 100644
--- a/app/models/lfs_object.rb
+++ b/app/models/lfs_object.rb
@@ -3,11 +3,11 @@
 # Table name: lfs_objects
 #
 #  id         :integer          not null, primary key
-#  oid        :string(255)      not null
+#  oid        :string           not null
 #  size       :integer          not null
 #  created_at :datetime
 #  updated_at :datetime
-#  file       :string(255)
+#  file       :string
 #
 
 class LfsObject < ActiveRecord::Base
diff --git a/app/models/member.rb b/app/models/member.rb
index 60efafef211791648a2420a7988a359873f0ed58..cca82da89f18797eb70b94d6b408c02d197e44a0 100644
--- a/app/models/member.rb
+++ b/app/models/member.rb
@@ -5,15 +5,15 @@
 #  id                 :integer          not null, primary key
 #  access_level       :integer          not null
 #  source_id          :integer          not null
-#  source_type        :string(255)      not null
+#  source_type        :string           not null
 #  user_id            :integer
 #  notification_level :integer          not null
-#  type               :string(255)
+#  type               :string
 #  created_at         :datetime
 #  updated_at         :datetime
 #  created_by_id      :integer
-#  invite_email       :string(255)
-#  invite_token       :string(255)
+#  invite_email       :string
+#  invite_token       :string
 #  invite_accepted_at :datetime
 #
 
diff --git a/app/models/members/group_member.rb b/app/models/members/group_member.rb
index 9fb474a1a93d8fd54dc278d789cfa13485c1c8af..a48c1943e6f86d2240b172d6dfa945f19aa0410f 100644
--- a/app/models/members/group_member.rb
+++ b/app/models/members/group_member.rb
@@ -5,15 +5,15 @@
 #  id                 :integer          not null, primary key
 #  access_level       :integer          not null
 #  source_id          :integer          not null
-#  source_type        :string(255)      not null
+#  source_type        :string           not null
 #  user_id            :integer
 #  notification_level :integer          not null
-#  type               :string(255)
+#  type               :string
 #  created_at         :datetime
 #  updated_at         :datetime
 #  created_by_id      :integer
-#  invite_email       :string(255)
-#  invite_token       :string(255)
+#  invite_email       :string
+#  invite_token       :string
 #  invite_accepted_at :datetime
 #
 
diff --git a/app/models/members/project_member.rb b/app/models/members/project_member.rb
index 07ddb02ae9dd6bba8da9b3ea4947d222ca60bc83..143350a0b55d8e1173c7eb0c05812da6f7279621 100644
--- a/app/models/members/project_member.rb
+++ b/app/models/members/project_member.rb
@@ -5,15 +5,15 @@
 #  id                 :integer          not null, primary key
 #  access_level       :integer          not null
 #  source_id          :integer          not null
-#  source_type        :string(255)      not null
+#  source_type        :string           not null
 #  user_id            :integer
 #  notification_level :integer          not null
-#  type               :string(255)
+#  type               :string
 #  created_at         :datetime
 #  updated_at         :datetime
 #  created_by_id      :integer
-#  invite_email       :string(255)
-#  invite_token       :string(255)
+#  invite_email       :string
+#  invite_token       :string
 #  invite_accepted_at :datetime
 #
 
diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb
index d00919c3b0c10ce0a2943561283c0354f8d5fcd3..4175e1e5fbabb9be841be4d40300b4a10806e763 100644
--- a/app/models/merge_request.rb
+++ b/app/models/merge_request.rb
@@ -3,28 +3,29 @@
 # Table name: merge_requests
 #
 #  id                        :integer          not null, primary key
-#  target_branch             :string(255)      not null
-#  source_branch             :string(255)      not null
+#  target_branch             :string           not null
+#  source_branch             :string           not null
 #  source_project_id         :integer          not null
 #  author_id                 :integer
 #  assignee_id               :integer
-#  title                     :string(255)
+#  title                     :string
 #  created_at                :datetime
 #  updated_at                :datetime
 #  milestone_id              :integer
-#  state                     :string(255)
-#  merge_status              :string(255)
+#  state                     :string
+#  merge_status              :string
 #  target_project_id         :integer          not null
 #  iid                       :integer
 #  description               :text
 #  position                  :integer          default(0)
 #  locked_at                 :datetime
 #  updated_by_id             :integer
-#  merge_error               :string(255)
+#  merge_error               :string
 #  merge_params              :text
 #  merge_when_build_succeeds :boolean          default(FALSE), not null
 #  merge_user_id             :integer
 #  merge_commit_sha          :string
+#  deleted_at                :datetime
 #
 
 class MergeRequest < ActiveRecord::Base
diff --git a/app/models/merge_request_diff.rb b/app/models/merge_request_diff.rb
index 0580cafdd1b1cb89d978e809a8cb3fb02fbb4ee2..8951e92a0b87dc8564af0147bf98c36087b1e386 100644
--- a/app/models/merge_request_diff.rb
+++ b/app/models/merge_request_diff.rb
@@ -3,12 +3,14 @@
 # Table name: merge_request_diffs
 #
 #  id               :integer          not null, primary key
-#  state            :string(255)
+#  state            :string
 #  st_commits       :text
 #  st_diffs         :text
 #  merge_request_id :integer          not null
 #  created_at       :datetime
 #  updated_at       :datetime
+#  base_commit_sha  :string
+#  real_size        :string
 #
 
 class MergeRequestDiff < ActiveRecord::Base
diff --git a/app/models/milestone.rb b/app/models/milestone.rb
index 986184dd3019d22cbf05013bed320792b5b7c8fb..5ee8a965ad8beafc090652ffcbbb457445a24f8e 100644
--- a/app/models/milestone.rb
+++ b/app/models/milestone.rb
@@ -3,13 +3,13 @@
 # Table name: milestones
 #
 #  id          :integer          not null, primary key
-#  title       :string(255)      not null
+#  title       :string           not null
 #  project_id  :integer          not null
 #  description :text
 #  due_date    :date
 #  created_at  :datetime
 #  updated_at  :datetime
-#  state       :string(255)
+#  state       :string
 #  iid         :integer
 #
 
diff --git a/app/models/namespace.rb b/app/models/namespace.rb
index 55842df1e2d3138919a52d4984c62ddd2e593d20..741e912171d5d2b546ae134b791b70e459d6a2d2 100644
--- a/app/models/namespace.rb
+++ b/app/models/namespace.rb
@@ -2,15 +2,17 @@
 #
 # Table name: namespaces
 #
-#  id          :integer          not null, primary key
-#  name        :string(255)      not null
-#  path        :string(255)      not null
-#  owner_id    :integer
-#  created_at  :datetime
-#  updated_at  :datetime
-#  type        :string(255)
-#  description :string(255)      default(""), not null
-#  avatar      :string(255)
+#  id                    :integer          not null, primary key
+#  name                  :string           not null
+#  path                  :string           not null
+#  owner_id              :integer
+#  created_at            :datetime
+#  updated_at            :datetime
+#  type                  :string
+#  description           :string           default(""), not null
+#  avatar                :string
+#  share_with_group_lock :boolean          default(FALSE)
+#  visibility_level      :integer          default(20), not null
 #
 
 class Namespace < ActiveRecord::Base
diff --git a/app/models/note.rb b/app/models/note.rb
index 71b4293d57a593fb98896fd4a49b6dee79571575..deee2b9e8854cf6aa64c75684dfbaaf85b5bc497 100644
--- a/app/models/note.rb
+++ b/app/models/note.rb
@@ -4,14 +4,14 @@
 #
 #  id            :integer          not null, primary key
 #  note          :text
-#  noteable_type :string(255)
+#  noteable_type :string
 #  author_id     :integer
 #  created_at    :datetime
 #  updated_at    :datetime
 #  project_id    :integer
-#  attachment    :string(255)
-#  line_code     :string(255)
-#  commit_id     :string(255)
+#  attachment    :string
+#  line_code     :string
+#  commit_id     :string
 #  noteable_id   :integer
 #  system        :boolean          default(FALSE), not null
 #  st_diff       :text
diff --git a/app/models/notification_setting.rb b/app/models/notification_setting.rb
index 5001738f411f43a05c678d7edf6d0fd85bbda8d6..846773752a67f03b6f9946e5cf23f8b40ff88fcc 100644
--- a/app/models/notification_setting.rb
+++ b/app/models/notification_setting.rb
@@ -1,3 +1,16 @@
+# == Schema Information
+#
+# Table name: notification_settings
+#
+#  id          :integer          not null, primary key
+#  user_id     :integer          not null
+#  source_id   :integer          not null
+#  source_type :string           not null
+#  level       :integer          default(0), not null
+#  created_at  :datetime         not null
+#  updated_at  :datetime         not null
+#
+
 class NotificationSetting < ActiveRecord::Base
   enum level: { disabled: 0,  participating: 1,  watch: 2,  global: 3, mention: 4 }
 
diff --git a/app/models/personal_snippet.rb b/app/models/personal_snippet.rb
index 452f3913eef66cdb897ceae9bbd720e302dba8ee..1d5f4c50254f6fa624fc75b8f584199d37371178 100644
--- a/app/models/personal_snippet.rb
+++ b/app/models/personal_snippet.rb
@@ -3,14 +3,14 @@
 # Table name: snippets
 #
 #  id               :integer          not null, primary key
-#  title            :string(255)
+#  title            :string
 #  content          :text
 #  author_id        :integer          not null
 #  project_id       :integer
 #  created_at       :datetime
 #  updated_at       :datetime
-#  file_name        :string(255)
-#  type             :string(255)
+#  file_name        :string
+#  type             :string
 #  visibility_level :integer          default(0), not null
 #
 
diff --git a/app/models/project.rb b/app/models/project.rb
index af62e8ecd90cb51e82b2d2584ff015c609749d98..9403acf77594406c67d83bf0ad3c313d872d8358 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -2,41 +2,46 @@
 #
 # Table name: projects
 #
-#  id                     :integer          not null, primary key
-#  name                   :string(255)
-#  path                   :string(255)
-#  description            :text
-#  created_at             :datetime
-#  updated_at             :datetime
-#  creator_id             :integer
-#  issues_enabled         :boolean          default(TRUE), not null
-#  wall_enabled           :boolean          default(TRUE), not null
-#  merge_requests_enabled :boolean          default(TRUE), not null
-#  wiki_enabled           :boolean          default(TRUE), not null
-#  namespace_id           :integer
-#  issues_tracker         :string(255)      default("gitlab"), not null
-#  issues_tracker_id      :string(255)
-#  snippets_enabled       :boolean          default(TRUE), not null
-#  last_activity_at       :datetime
-#  import_url             :string(255)
-#  visibility_level       :integer          default(0), not null
-#  archived               :boolean          default(FALSE), not null
-#  avatar                 :string(255)
-#  import_status          :string(255)
-#  repository_size        :float            default(0.0)
-#  star_count             :integer          default(0), not null
-#  import_type            :string(255)
-#  import_source          :string(255)
-#  commit_count           :integer          default(0)
-#  import_error           :text
-#  ci_id                  :integer
-#  builds_enabled         :boolean          default(TRUE), not null
-#  shared_runners_enabled :boolean          default(TRUE), not null
-#  runners_token          :string
-#  build_coverage_regex   :string
-#  build_allow_git_fetch  :boolean          default(TRUE), not null
-#  build_timeout          :integer          default(3600), not null
-#  pending_delete         :boolean
+#  id                           :integer          not null, primary key
+#  name                         :string
+#  path                         :string
+#  description                  :text
+#  created_at                   :datetime
+#  updated_at                   :datetime
+#  creator_id                   :integer
+#  issues_enabled               :boolean          default(TRUE), not null
+#  wall_enabled                 :boolean          default(TRUE), not null
+#  merge_requests_enabled       :boolean          default(TRUE), not null
+#  wiki_enabled                 :boolean          default(TRUE), not null
+#  namespace_id                 :integer
+#  issues_tracker               :string           default("gitlab"), not null
+#  issues_tracker_id            :string
+#  snippets_enabled             :boolean          default(TRUE), not null
+#  last_activity_at             :datetime
+#  import_url                   :string
+#  visibility_level             :integer          default(0), not null
+#  archived                     :boolean          default(FALSE), not null
+#  avatar                       :string
+#  import_status                :string
+#  repository_size              :float            default(0.0)
+#  star_count                   :integer          default(0), not null
+#  import_type                  :string
+#  import_source                :string
+#  commit_count                 :integer          default(0)
+#  import_error                 :text
+#  ci_id                        :integer
+#  builds_enabled               :boolean          default(TRUE), not null
+#  shared_runners_enabled       :boolean          default(TRUE), not null
+#  runners_token                :string
+#  build_coverage_regex         :string
+#  build_allow_git_fetch        :boolean          default(TRUE), not null
+#  build_timeout                :integer          default(3600), not null
+#  pending_delete               :boolean          default(FALSE)
+#  public_builds                :boolean          default(TRUE), not null
+#  main_language                :string
+#  pushes_since_gc              :integer          default(0)
+#  last_repository_check_failed :boolean
+#  last_repository_check_at     :datetime
 #
 
 require 'carrierwave/orm/activerecord'
diff --git a/app/models/project_group_link.rb b/app/models/project_group_link.rb
index e52a6bd7c8473b69054824db5724ae4d12d77954..66f5a609bf5f3035a1f986e092472fb0e4cf88d3 100644
--- a/app/models/project_group_link.rb
+++ b/app/models/project_group_link.rb
@@ -1,3 +1,15 @@
+# == Schema Information
+#
+# Table name: project_group_links
+#
+#  id           :integer          not null, primary key
+#  project_id   :integer          not null
+#  group_id     :integer          not null
+#  created_at   :datetime
+#  updated_at   :datetime
+#  group_access :integer          default(30), not null
+#
+
 class ProjectGroupLink < ActiveRecord::Base
   GUEST     = 10
   REPORTER  = 20
diff --git a/app/models/project_import_data.rb b/app/models/project_import_data.rb
index 2c0ae312f1babbf034f49b686d224d3dcff5e471..3f0080205dd8b369eb4c8e0a2a1cc1b0ad7d5342 100644
--- a/app/models/project_import_data.rb
+++ b/app/models/project_import_data.rb
@@ -2,9 +2,12 @@
 #
 # Table name: project_import_data
 #
-#  id         :integer          not null, primary key
-#  project_id :integer
-#  data       :text
+#  id                         :integer          not null, primary key
+#  project_id                 :integer
+#  data                       :text
+#  encrypted_credentials      :text
+#  encrypted_credentials_iv   :text
+#  encrypted_credentials_salt :text
 #
 
 require 'carrierwave/orm/activerecord'
diff --git a/app/models/project_services/asana_service.rb b/app/models/project_services/asana_service.rb
index 792ad804575841ea64200a967e96d083883e607f..368485a060aa8e433b536d7512e4220ff2ca5766 100644
--- a/app/models/project_services/asana_service.rb
+++ b/app/models/project_services/asana_service.rb
@@ -3,12 +3,12 @@
 # Table name: services
 #
 #  id                    :integer          not null, primary key
-#  type                  :string(255)
-#  title                 :string(255)
+#  type                  :string
+#  title                 :string
 #  project_id            :integer
-#  created_at            :datetime
-#  updated_at            :datetime
-#  active                :boolean          default(FALSE), not null
+#  created_at            :datetime         not null
+#  updated_at            :datetime         not null
+#  active                :boolean          not null
 #  properties            :text
 #  template              :boolean          default(FALSE)
 #  push_events           :boolean          default(TRUE)
@@ -17,6 +17,9 @@
 #  tag_push_events       :boolean          default(TRUE)
 #  note_events           :boolean          default(TRUE), not null
 #  build_events          :boolean          default(FALSE), not null
+#  category              :string           default("common"), not null
+#  default               :boolean          default(FALSE)
+#  wiki_page_events      :boolean          default(TRUE)
 #
 
 require 'asana'
diff --git a/app/models/project_services/assembla_service.rb b/app/models/project_services/assembla_service.rb
index 29d841faed855b2180c4d8719a19732e6a6ef9d7..ffb7455b0143db3f819977ee441b95adcfb0877c 100644
--- a/app/models/project_services/assembla_service.rb
+++ b/app/models/project_services/assembla_service.rb
@@ -3,12 +3,12 @@
 # Table name: services
 #
 #  id                    :integer          not null, primary key
-#  type                  :string(255)
-#  title                 :string(255)
+#  type                  :string
+#  title                 :string
 #  project_id            :integer
-#  created_at            :datetime
-#  updated_at            :datetime
-#  active                :boolean          default(FALSE), not null
+#  created_at            :datetime         not null
+#  updated_at            :datetime         not null
+#  active                :boolean          not null
 #  properties            :text
 #  template              :boolean          default(FALSE)
 #  push_events           :boolean          default(TRUE)
@@ -17,6 +17,9 @@
 #  tag_push_events       :boolean          default(TRUE)
 #  note_events           :boolean          default(TRUE), not null
 #  build_events          :boolean          default(FALSE), not null
+#  category              :string           default("common"), not null
+#  default               :boolean          default(FALSE)
+#  wiki_page_events      :boolean          default(TRUE)
 #
 
 class AssemblaService < Service
diff --git a/app/models/project_services/bamboo_service.rb b/app/models/project_services/bamboo_service.rb
index 060062aaf7ad94bf96a77f8980cebcbbf1042b07..c36ee95e37801ef34a43bca57d245bf50284d7b9 100644
--- a/app/models/project_services/bamboo_service.rb
+++ b/app/models/project_services/bamboo_service.rb
@@ -3,12 +3,12 @@
 # Table name: services
 #
 #  id                    :integer          not null, primary key
-#  type                  :string(255)
-#  title                 :string(255)
+#  type                  :string
+#  title                 :string
 #  project_id            :integer
-#  created_at            :datetime
-#  updated_at            :datetime
-#  active                :boolean          default(FALSE), not null
+#  created_at            :datetime         not null
+#  updated_at            :datetime         not null
+#  active                :boolean          not null
 #  properties            :text
 #  template              :boolean          default(FALSE)
 #  push_events           :boolean          default(TRUE)
@@ -17,6 +17,9 @@
 #  tag_push_events       :boolean          default(TRUE)
 #  note_events           :boolean          default(TRUE), not null
 #  build_events          :boolean          default(FALSE), not null
+#  category              :string           default("common"), not null
+#  default               :boolean          default(FALSE)
+#  wiki_page_events      :boolean          default(TRUE)
 #
 
 class BambooService < CiService
diff --git a/app/models/project_services/buildkite_service.rb b/app/models/project_services/buildkite_service.rb
index 861cc974ec415ddb28e652f8a8be2f87a19e1f2c..f9f4897a065f02117983564936f731db81f38dda 100644
--- a/app/models/project_services/buildkite_service.rb
+++ b/app/models/project_services/buildkite_service.rb
@@ -3,12 +3,12 @@
 # Table name: services
 #
 #  id                    :integer          not null, primary key
-#  type                  :string(255)
-#  title                 :string(255)
+#  type                  :string
+#  title                 :string
 #  project_id            :integer
-#  created_at            :datetime
-#  updated_at            :datetime
-#  active                :boolean          default(FALSE), not null
+#  created_at            :datetime         not null
+#  updated_at            :datetime         not null
+#  active                :boolean          not null
 #  properties            :text
 #  template              :boolean          default(FALSE)
 #  push_events           :boolean          default(TRUE)
@@ -17,6 +17,9 @@
 #  tag_push_events       :boolean          default(TRUE)
 #  note_events           :boolean          default(TRUE), not null
 #  build_events          :boolean          default(FALSE), not null
+#  category              :string           default("common"), not null
+#  default               :boolean          default(FALSE)
+#  wiki_page_events      :boolean          default(TRUE)
 #
 
 require "addressable/uri"
diff --git a/app/models/project_services/builds_email_service.rb b/app/models/project_services/builds_email_service.rb
index 6ab6d7417b715ef7afaca937b368e83d8122d2b3..20cdfcaffb210e1e0b38621b15197b6253eca084 100644
--- a/app/models/project_services/builds_email_service.rb
+++ b/app/models/project_services/builds_email_service.rb
@@ -3,12 +3,12 @@
 # Table name: services
 #
 #  id                    :integer          not null, primary key
-#  type                  :string(255)
-#  title                 :string(255)
+#  type                  :string
+#  title                 :string
 #  project_id            :integer
-#  created_at            :datetime
-#  updated_at            :datetime
-#  active                :boolean          default(FALSE), not null
+#  created_at            :datetime         not null
+#  updated_at            :datetime         not null
+#  active                :boolean          not null
 #  properties            :text
 #  template              :boolean          default(FALSE)
 #  push_events           :boolean          default(TRUE)
@@ -17,6 +17,9 @@
 #  tag_push_events       :boolean          default(TRUE)
 #  note_events           :boolean          default(TRUE), not null
 #  build_events          :boolean          default(FALSE), not null
+#  category              :string           default("common"), not null
+#  default               :boolean          default(FALSE)
+#  wiki_page_events      :boolean          default(TRUE)
 #
 
 class BuildsEmailService < Service
diff --git a/app/models/project_services/campfire_service.rb b/app/models/project_services/campfire_service.rb
index 6e8f08425249352c65fe568264f8237cb47fdf69..28c969fe57f3f170d818ba7e95965a8549f58368 100644
--- a/app/models/project_services/campfire_service.rb
+++ b/app/models/project_services/campfire_service.rb
@@ -3,12 +3,12 @@
 # Table name: services
 #
 #  id                    :integer          not null, primary key
-#  type                  :string(255)
-#  title                 :string(255)
+#  type                  :string
+#  title                 :string
 #  project_id            :integer
-#  created_at            :datetime
-#  updated_at            :datetime
-#  active                :boolean          default(FALSE), not null
+#  created_at            :datetime         not null
+#  updated_at            :datetime         not null
+#  active                :boolean          not null
 #  properties            :text
 #  template              :boolean          default(FALSE)
 #  push_events           :boolean          default(TRUE)
@@ -17,6 +17,9 @@
 #  tag_push_events       :boolean          default(TRUE)
 #  note_events           :boolean          default(TRUE), not null
 #  build_events          :boolean          default(FALSE), not null
+#  category              :string           default("common"), not null
+#  default               :boolean          default(FALSE)
+#  wiki_page_events      :boolean          default(TRUE)
 #
 
 class CampfireService < Service
diff --git a/app/models/project_services/ci_service.rb b/app/models/project_services/ci_service.rb
index d9f0849d1470b5f316c35a49540f9b69b1df8214..9bc8f982da614a95239431ae33e665ad5f089491 100644
--- a/app/models/project_services/ci_service.rb
+++ b/app/models/project_services/ci_service.rb
@@ -3,12 +3,12 @@
 # Table name: services
 #
 #  id                    :integer          not null, primary key
-#  type                  :string(255)
-#  title                 :string(255)
+#  type                  :string
+#  title                 :string
 #  project_id            :integer
-#  created_at            :datetime
-#  updated_at            :datetime
-#  active                :boolean          default(FALSE), not null
+#  created_at            :datetime         not null
+#  updated_at            :datetime         not null
+#  active                :boolean          not null
 #  properties            :text
 #  template              :boolean          default(FALSE)
 #  push_events           :boolean          default(TRUE)
@@ -17,6 +17,9 @@
 #  tag_push_events       :boolean          default(TRUE)
 #  note_events           :boolean          default(TRUE), not null
 #  build_events          :boolean          default(FALSE), not null
+#  category              :string           default("common"), not null
+#  default               :boolean          default(FALSE)
+#  wiki_page_events      :boolean          default(TRUE)
 #
 
 # Base class for CI services
diff --git a/app/models/project_services/custom_issue_tracker_service.rb b/app/models/project_services/custom_issue_tracker_service.rb
index 88a3e9218cb407ca7e6d44e4c43fa4c2ded6b49d..4d1319eb6f8329f0a8a5390bdf753bc48e548343 100644
--- a/app/models/project_services/custom_issue_tracker_service.rb
+++ b/app/models/project_services/custom_issue_tracker_service.rb
@@ -3,12 +3,12 @@
 # Table name: services
 #
 #  id                    :integer          not null, primary key
-#  type                  :string(255)
-#  title                 :string(255)
+#  type                  :string
+#  title                 :string
 #  project_id            :integer
-#  created_at            :datetime
-#  updated_at            :datetime
-#  active                :boolean          default(FALSE), not null
+#  created_at            :datetime         not null
+#  updated_at            :datetime         not null
+#  active                :boolean          not null
 #  properties            :text
 #  template              :boolean          default(FALSE)
 #  push_events           :boolean          default(TRUE)
@@ -17,6 +17,9 @@
 #  tag_push_events       :boolean          default(TRUE)
 #  note_events           :boolean          default(TRUE), not null
 #  build_events          :boolean          default(FALSE), not null
+#  category              :string           default("common"), not null
+#  default               :boolean          default(FALSE)
+#  wiki_page_events      :boolean          default(TRUE)
 #
 
 class CustomIssueTrackerService < IssueTrackerService
diff --git a/app/models/project_services/drone_ci_service.rb b/app/models/project_services/drone_ci_service.rb
index b4724bb647e7e73260c88230920a9b2585d34da0..d8e00e018cc5627de1d30213b7f9f6575e59fe72 100644
--- a/app/models/project_services/drone_ci_service.rb
+++ b/app/models/project_services/drone_ci_service.rb
@@ -3,12 +3,12 @@
 # Table name: services
 #
 #  id                    :integer          not null, primary key
-#  type                  :string(255)
-#  title                 :string(255)
+#  type                  :string
+#  title                 :string
 #  project_id            :integer
-#  created_at            :datetime
-#  updated_at            :datetime
-#  active                :boolean          default(FALSE), not null
+#  created_at            :datetime         not null
+#  updated_at            :datetime         not null
+#  active                :boolean          not null
 #  properties            :text
 #  template              :boolean          default(FALSE)
 #  push_events           :boolean          default(TRUE)
@@ -17,6 +17,9 @@
 #  tag_push_events       :boolean          default(TRUE)
 #  note_events           :boolean          default(TRUE), not null
 #  build_events          :boolean          default(FALSE), not null
+#  category              :string           default("common"), not null
+#  default               :boolean          default(FALSE)
+#  wiki_page_events      :boolean          default(TRUE)
 #
 
 class DroneCiService < CiService
diff --git a/app/models/project_services/emails_on_push_service.rb b/app/models/project_services/emails_on_push_service.rb
index b831577cd97a614bea8e5e8631f268df1059943e..2dbd29062dfac65a79aa2c878c07d68a8d044eff 100644
--- a/app/models/project_services/emails_on_push_service.rb
+++ b/app/models/project_services/emails_on_push_service.rb
@@ -3,12 +3,12 @@
 # Table name: services
 #
 #  id                    :integer          not null, primary key
-#  type                  :string(255)
-#  title                 :string(255)
+#  type                  :string
+#  title                 :string
 #  project_id            :integer
-#  created_at            :datetime
-#  updated_at            :datetime
-#  active                :boolean          default(FALSE), not null
+#  created_at            :datetime         not null
+#  updated_at            :datetime         not null
+#  active                :boolean          not null
 #  properties            :text
 #  template              :boolean          default(FALSE)
 #  push_events           :boolean          default(TRUE)
@@ -17,6 +17,9 @@
 #  tag_push_events       :boolean          default(TRUE)
 #  note_events           :boolean          default(TRUE), not null
 #  build_events          :boolean          default(FALSE), not null
+#  category              :string           default("common"), not null
+#  default               :boolean          default(FALSE)
+#  wiki_page_events      :boolean          default(TRUE)
 #
 
 class EmailsOnPushService < Service
diff --git a/app/models/project_services/external_wiki_service.rb b/app/models/project_services/external_wiki_service.rb
index b402b68665af18ba6c9151f2b20629690f99ccdd..5469049bb5eb74a91152efca355772133fc4e30a 100644
--- a/app/models/project_services/external_wiki_service.rb
+++ b/app/models/project_services/external_wiki_service.rb
@@ -3,12 +3,12 @@
 # Table name: services
 #
 #  id                    :integer          not null, primary key
-#  type                  :string(255)
-#  title                 :string(255)
+#  type                  :string
+#  title                 :string
 #  project_id            :integer
-#  created_at            :datetime
-#  updated_at            :datetime
-#  active                :boolean          default(FALSE), not null
+#  created_at            :datetime         not null
+#  updated_at            :datetime         not null
+#  active                :boolean          not null
 #  properties            :text
 #  template              :boolean          default(FALSE)
 #  push_events           :boolean          default(TRUE)
@@ -17,6 +17,9 @@
 #  tag_push_events       :boolean          default(TRUE)
 #  note_events           :boolean          default(TRUE), not null
 #  build_events          :boolean          default(FALSE), not null
+#  category              :string           default("common"), not null
+#  default               :boolean          default(FALSE)
+#  wiki_page_events      :boolean          default(TRUE)
 #
 
 class ExternalWikiService < Service
diff --git a/app/models/project_services/flowdock_service.rb b/app/models/project_services/flowdock_service.rb
index 8605ce66e48ba2f8666363ad35ce4e41fed9dfc6..3dc1e0fbe8b9ca75a26385a2a3d5e65c81ee5f99 100644
--- a/app/models/project_services/flowdock_service.rb
+++ b/app/models/project_services/flowdock_service.rb
@@ -3,12 +3,12 @@
 # Table name: services
 #
 #  id                    :integer          not null, primary key
-#  type                  :string(255)
-#  title                 :string(255)
+#  type                  :string
+#  title                 :string
 #  project_id            :integer
-#  created_at            :datetime
-#  updated_at            :datetime
-#  active                :boolean          default(FALSE), not null
+#  created_at            :datetime         not null
+#  updated_at            :datetime         not null
+#  active                :boolean          not null
 #  properties            :text
 #  template              :boolean          default(FALSE)
 #  push_events           :boolean          default(TRUE)
@@ -17,6 +17,9 @@
 #  tag_push_events       :boolean          default(TRUE)
 #  note_events           :boolean          default(TRUE), not null
 #  build_events          :boolean          default(FALSE), not null
+#  category              :string           default("common"), not null
+#  default               :boolean          default(FALSE)
+#  wiki_page_events      :boolean          default(TRUE)
 #
 
 require "flowdock-git-hook"
diff --git a/app/models/project_services/gemnasium_service.rb b/app/models/project_services/gemnasium_service.rb
index 61babe9cfe504f940b97b55b13951ff00d4bbc60..b4c311cf664d9223bab202f3eb43cb5ff69c90da 100644
--- a/app/models/project_services/gemnasium_service.rb
+++ b/app/models/project_services/gemnasium_service.rb
@@ -3,12 +3,12 @@
 # Table name: services
 #
 #  id                    :integer          not null, primary key
-#  type                  :string(255)
-#  title                 :string(255)
+#  type                  :string
+#  title                 :string
 #  project_id            :integer
-#  created_at            :datetime
-#  updated_at            :datetime
-#  active                :boolean          default(FALSE), not null
+#  created_at            :datetime         not null
+#  updated_at            :datetime         not null
+#  active                :boolean          not null
 #  properties            :text
 #  template              :boolean          default(FALSE)
 #  push_events           :boolean          default(TRUE)
@@ -17,6 +17,9 @@
 #  tag_push_events       :boolean          default(TRUE)
 #  note_events           :boolean          default(TRUE), not null
 #  build_events          :boolean          default(FALSE), not null
+#  category              :string           default("common"), not null
+#  default               :boolean          default(FALSE)
+#  wiki_page_events      :boolean          default(TRUE)
 #
 
 require "gemnasium/gitlab_service"
diff --git a/app/models/project_services/gitlab_ci_service.rb b/app/models/project_services/gitlab_ci_service.rb
index 33f0d7ea01acb43d1436087bb9b1d2ae2aeb0363..a92f722608388ee5158eef8eda23680fac3cbefd 100644
--- a/app/models/project_services/gitlab_ci_service.rb
+++ b/app/models/project_services/gitlab_ci_service.rb
@@ -3,12 +3,12 @@
 # Table name: services
 #
 #  id                    :integer          not null, primary key
-#  type                  :string(255)
-#  title                 :string(255)
+#  type                  :string
+#  title                 :string
 #  project_id            :integer
-#  created_at            :datetime
-#  updated_at            :datetime
-#  active                :boolean          default(FALSE), not null
+#  created_at            :datetime         not null
+#  updated_at            :datetime         not null
+#  active                :boolean          not null
 #  properties            :text
 #  template              :boolean          default(FALSE)
 #  push_events           :boolean          default(TRUE)
@@ -17,6 +17,9 @@
 #  tag_push_events       :boolean          default(TRUE)
 #  note_events           :boolean          default(TRUE), not null
 #  build_events          :boolean          default(FALSE), not null
+#  category              :string           default("common"), not null
+#  default               :boolean          default(FALSE)
+#  wiki_page_events      :boolean          default(TRUE)
 #
 
 # TODO(ayufan): The GitLabCiService is deprecated and the type should be removed when the database entries are removed
diff --git a/app/models/project_services/gitlab_issue_tracker_service.rb b/app/models/project_services/gitlab_issue_tracker_service.rb
index eaa5654b9c6f7f8e237edfb57b05442deecb04f3..1adaeeb3b2baa5b9c6a5db7ad703e34faef6da1e 100644
--- a/app/models/project_services/gitlab_issue_tracker_service.rb
+++ b/app/models/project_services/gitlab_issue_tracker_service.rb
@@ -3,12 +3,12 @@
 # Table name: services
 #
 #  id                    :integer          not null, primary key
-#  type                  :string(255)
-#  title                 :string(255)
+#  type                  :string
+#  title                 :string
 #  project_id            :integer
-#  created_at            :datetime
-#  updated_at            :datetime
-#  active                :boolean          default(FALSE), not null
+#  created_at            :datetime         not null
+#  updated_at            :datetime         not null
+#  active                :boolean          not null
 #  properties            :text
 #  template              :boolean          default(FALSE)
 #  push_events           :boolean          default(TRUE)
@@ -17,6 +17,9 @@
 #  tag_push_events       :boolean          default(TRUE)
 #  note_events           :boolean          default(TRUE), not null
 #  build_events          :boolean          default(FALSE), not null
+#  category              :string           default("common"), not null
+#  default               :boolean          default(FALSE)
+#  wiki_page_events      :boolean          default(TRUE)
 #
 
 class GitlabIssueTrackerService < IssueTrackerService
diff --git a/app/models/project_services/hipchat_service.rb b/app/models/project_services/hipchat_service.rb
index 064ef8e8674a80f7ca5a0e3d4dead37d4cd47302..f9ddf5887226ddd120ca39f6390d34ad3682e4ea 100644
--- a/app/models/project_services/hipchat_service.rb
+++ b/app/models/project_services/hipchat_service.rb
@@ -3,12 +3,12 @@
 # Table name: services
 #
 #  id                    :integer          not null, primary key
-#  type                  :string(255)
-#  title                 :string(255)
+#  type                  :string
+#  title                 :string
 #  project_id            :integer
-#  created_at            :datetime
-#  updated_at            :datetime
-#  active                :boolean          default(FALSE), not null
+#  created_at            :datetime         not null
+#  updated_at            :datetime         not null
+#  active                :boolean          not null
 #  properties            :text
 #  template              :boolean          default(FALSE)
 #  push_events           :boolean          default(TRUE)
@@ -17,6 +17,9 @@
 #  tag_push_events       :boolean          default(TRUE)
 #  note_events           :boolean          default(TRUE), not null
 #  build_events          :boolean          default(FALSE), not null
+#  category              :string           default("common"), not null
+#  default               :boolean          default(FALSE)
+#  wiki_page_events      :boolean          default(TRUE)
 #
 
 class HipchatService < Service
diff --git a/app/models/project_services/irker_service.rb b/app/models/project_services/irker_service.rb
index 04c714bfaad4fddee9d29a4fd0ecb4591a26e0af..b9a592d709635b46d4cfe53d4028877da5d6e964 100644
--- a/app/models/project_services/irker_service.rb
+++ b/app/models/project_services/irker_service.rb
@@ -3,12 +3,12 @@
 # Table name: services
 #
 #  id                    :integer          not null, primary key
-#  type                  :string(255)
-#  title                 :string(255)
+#  type                  :string
+#  title                 :string
 #  project_id            :integer
-#  created_at            :datetime
-#  updated_at            :datetime
-#  active                :boolean          default(FALSE), not null
+#  created_at            :datetime         not null
+#  updated_at            :datetime         not null
+#  active                :boolean          not null
 #  properties            :text
 #  template              :boolean          default(FALSE)
 #  push_events           :boolean          default(TRUE)
@@ -17,6 +17,9 @@
 #  tag_push_events       :boolean          default(TRUE)
 #  note_events           :boolean          default(TRUE), not null
 #  build_events          :boolean          default(FALSE), not null
+#  category              :string           default("common"), not null
+#  default               :boolean          default(FALSE)
+#  wiki_page_events      :boolean          default(TRUE)
 #
 
 require 'uri'
diff --git a/app/models/project_services/issue_tracker_service.rb b/app/models/project_services/issue_tracker_service.rb
index c5501e06411bb8ea7d88c52b947694a0bd563875..98a3a7c6b86f3c871a6e38aa9cb8e0fa77e291d6 100644
--- a/app/models/project_services/issue_tracker_service.rb
+++ b/app/models/project_services/issue_tracker_service.rb
@@ -3,12 +3,12 @@
 # Table name: services
 #
 #  id                    :integer          not null, primary key
-#  type                  :string(255)
-#  title                 :string(255)
+#  type                  :string
+#  title                 :string
 #  project_id            :integer
-#  created_at            :datetime
-#  updated_at            :datetime
-#  active                :boolean          default(FALSE), not null
+#  created_at            :datetime         not null
+#  updated_at            :datetime         not null
+#  active                :boolean          not null
 #  properties            :text
 #  template              :boolean          default(FALSE)
 #  push_events           :boolean          default(TRUE)
@@ -17,6 +17,9 @@
 #  tag_push_events       :boolean          default(TRUE)
 #  note_events           :boolean          default(TRUE), not null
 #  build_events          :boolean          default(FALSE), not null
+#  category              :string           default("common"), not null
+#  default               :boolean          default(FALSE)
+#  wiki_page_events      :boolean          default(TRUE)
 #
 
 class IssueTrackerService < Service
diff --git a/app/models/project_services/jira_service.rb b/app/models/project_services/jira_service.rb
index b4418ba9284b1a6dc5fd8522f641800d9a254d38..ba68658f0bd16229f3a2ea8d283773d21e5d7216 100644
--- a/app/models/project_services/jira_service.rb
+++ b/app/models/project_services/jira_service.rb
@@ -3,12 +3,12 @@
 # Table name: services
 #
 #  id                    :integer          not null, primary key
-#  type                  :string(255)
-#  title                 :string(255)
+#  type                  :string
+#  title                 :string
 #  project_id            :integer
-#  created_at            :datetime
-#  updated_at            :datetime
-#  active                :boolean          default(FALSE), not null
+#  created_at            :datetime         not null
+#  updated_at            :datetime         not null
+#  active                :boolean          not null
 #  properties            :text
 #  template              :boolean          default(FALSE)
 #  push_events           :boolean          default(TRUE)
@@ -17,6 +17,9 @@
 #  tag_push_events       :boolean          default(TRUE)
 #  note_events           :boolean          default(TRUE), not null
 #  build_events          :boolean          default(FALSE), not null
+#  category              :string           default("common"), not null
+#  default               :boolean          default(FALSE)
+#  wiki_page_events      :boolean          default(TRUE)
 #
 
 class JiraService < IssueTrackerService
diff --git a/app/models/project_services/pivotaltracker_service.rb b/app/models/project_services/pivotaltracker_service.rb
index c9a890c7e3f5a8a90dda602cbf8ac9ad6f5fae7b..acaa0c393651d291c8d2f35ed15a25368c99d96e 100644
--- a/app/models/project_services/pivotaltracker_service.rb
+++ b/app/models/project_services/pivotaltracker_service.rb
@@ -3,12 +3,12 @@
 # Table name: services
 #
 #  id                    :integer          not null, primary key
-#  type                  :string(255)
-#  title                 :string(255)
+#  type                  :string
+#  title                 :string
 #  project_id            :integer
-#  created_at            :datetime
-#  updated_at            :datetime
-#  active                :boolean          default(FALSE), not null
+#  created_at            :datetime         not null
+#  updated_at            :datetime         not null
+#  active                :boolean          not null
 #  properties            :text
 #  template              :boolean          default(FALSE)
 #  push_events           :boolean          default(TRUE)
@@ -17,6 +17,9 @@
 #  tag_push_events       :boolean          default(TRUE)
 #  note_events           :boolean          default(TRUE), not null
 #  build_events          :boolean          default(FALSE), not null
+#  category              :string           default("common"), not null
+#  default               :boolean          default(FALSE)
+#  wiki_page_events      :boolean          default(TRUE)
 #
 
 class PivotaltrackerService < Service
diff --git a/app/models/project_services/pushover_service.rb b/app/models/project_services/pushover_service.rb
index e76d9eca2abadba4bc03d97652440f359628004c..a640c8cb4404c2b3e3b1d790dd6cd53312720691 100644
--- a/app/models/project_services/pushover_service.rb
+++ b/app/models/project_services/pushover_service.rb
@@ -3,12 +3,12 @@
 # Table name: services
 #
 #  id                    :integer          not null, primary key
-#  type                  :string(255)
-#  title                 :string(255)
+#  type                  :string
+#  title                 :string
 #  project_id            :integer
-#  created_at            :datetime
-#  updated_at            :datetime
-#  active                :boolean          default(FALSE), not null
+#  created_at            :datetime         not null
+#  updated_at            :datetime         not null
+#  active                :boolean          not null
 #  properties            :text
 #  template              :boolean          default(FALSE)
 #  push_events           :boolean          default(TRUE)
@@ -17,6 +17,9 @@
 #  tag_push_events       :boolean          default(TRUE)
 #  note_events           :boolean          default(TRUE), not null
 #  build_events          :boolean          default(FALSE), not null
+#  category              :string           default("common"), not null
+#  default               :boolean          default(FALSE)
+#  wiki_page_events      :boolean          default(TRUE)
 #
 
 class PushoverService < Service
diff --git a/app/models/project_services/redmine_service.rb b/app/models/project_services/redmine_service.rb
index de974354c77f7370934c7138b93bc13e6b7923dd..e2137e92c6279872ab21fdbe193da2661232a62c 100644
--- a/app/models/project_services/redmine_service.rb
+++ b/app/models/project_services/redmine_service.rb
@@ -3,12 +3,12 @@
 # Table name: services
 #
 #  id                    :integer          not null, primary key
-#  type                  :string(255)
-#  title                 :string(255)
+#  type                  :string
+#  title                 :string
 #  project_id            :integer
-#  created_at            :datetime
-#  updated_at            :datetime
-#  active                :boolean          default(FALSE), not null
+#  created_at            :datetime         not null
+#  updated_at            :datetime         not null
+#  active                :boolean          not null
 #  properties            :text
 #  template              :boolean          default(FALSE)
 #  push_events           :boolean          default(TRUE)
@@ -17,6 +17,9 @@
 #  tag_push_events       :boolean          default(TRUE)
 #  note_events           :boolean          default(TRUE), not null
 #  build_events          :boolean          default(FALSE), not null
+#  category              :string           default("common"), not null
+#  default               :boolean          default(FALSE)
+#  wiki_page_events      :boolean          default(TRUE)
 #
 
 class RedmineService < IssueTrackerService
diff --git a/app/models/project_services/slack_service.rb b/app/models/project_services/slack_service.rb
index 7092b757549ea93265d6ab5c1601e94048678edb..83ffa53a407e35088c347fa5975a76e2a0673e28 100644
--- a/app/models/project_services/slack_service.rb
+++ b/app/models/project_services/slack_service.rb
@@ -3,12 +3,12 @@
 # Table name: services
 #
 #  id                    :integer          not null, primary key
-#  type                  :string(255)
-#  title                 :string(255)
+#  type                  :string
+#  title                 :string
 #  project_id            :integer
-#  created_at            :datetime
-#  updated_at            :datetime
-#  active                :boolean          default(FALSE), not null
+#  created_at            :datetime         not null
+#  updated_at            :datetime         not null
+#  active                :boolean          not null
 #  properties            :text
 #  template              :boolean          default(FALSE)
 #  push_events           :boolean          default(TRUE)
@@ -17,6 +17,9 @@
 #  tag_push_events       :boolean          default(TRUE)
 #  note_events           :boolean          default(TRUE), not null
 #  build_events          :boolean          default(FALSE), not null
+#  category              :string           default("common"), not null
+#  default               :boolean          default(FALSE)
+#  wiki_page_events      :boolean          default(TRUE)
 #
 
 class SlackService < Service
diff --git a/app/models/project_services/teamcity_service.rb b/app/models/project_services/teamcity_service.rb
index 8dceee5e2c50c0f05f9b7e7765b9a9ffd33251fe..4015da31509a72ff2ce7667598e1264b708ba9d4 100644
--- a/app/models/project_services/teamcity_service.rb
+++ b/app/models/project_services/teamcity_service.rb
@@ -3,12 +3,12 @@
 # Table name: services
 #
 #  id                    :integer          not null, primary key
-#  type                  :string(255)
-#  title                 :string(255)
+#  type                  :string
+#  title                 :string
 #  project_id            :integer
-#  created_at            :datetime
-#  updated_at            :datetime
-#  active                :boolean          default(FALSE), not null
+#  created_at            :datetime         not null
+#  updated_at            :datetime         not null
+#  active                :boolean          not null
 #  properties            :text
 #  template              :boolean          default(FALSE)
 #  push_events           :boolean          default(TRUE)
@@ -17,6 +17,9 @@
 #  tag_push_events       :boolean          default(TRUE)
 #  note_events           :boolean          default(TRUE), not null
 #  build_events          :boolean          default(FALSE), not null
+#  category              :string           default("common"), not null
+#  default               :boolean          default(FALSE)
+#  wiki_page_events      :boolean          default(TRUE)
 #
 
 class TeamcityService < CiService
diff --git a/app/models/project_snippet.rb b/app/models/project_snippet.rb
index d48f0546159f7fc8e0f5bd19cffe11bdf3c07ded..b4b2807eba43ec258e862825145c2ea655082e3f 100644
--- a/app/models/project_snippet.rb
+++ b/app/models/project_snippet.rb
@@ -3,14 +3,14 @@
 # Table name: snippets
 #
 #  id               :integer          not null, primary key
-#  title            :string(255)
+#  title            :string
 #  content          :text
 #  author_id        :integer          not null
 #  project_id       :integer
 #  created_at       :datetime
 #  updated_at       :datetime
-#  file_name        :string(255)
-#  type             :string(255)
+#  file_name        :string
+#  type             :string
 #  visibility_level :integer          default(0), not null
 #
 
diff --git a/app/models/protected_branch.rb b/app/models/protected_branch.rb
index 8ebd790a89e1be20e12c4a6764f1cc4709a4441e..3d2052c892ca75b8cdfa0829065362475c33af37 100644
--- a/app/models/protected_branch.rb
+++ b/app/models/protected_branch.rb
@@ -4,7 +4,7 @@
 #
 #  id                  :integer          not null, primary key
 #  project_id          :integer          not null
-#  name                :string(255)      not null
+#  name                :string           not null
 #  created_at          :datetime
 #  updated_at          :datetime
 #  developers_can_push :boolean          default(FALSE), not null
diff --git a/app/models/release.rb b/app/models/release.rb
index 89f70278af5bac889e5af3aa79a4a0de9e8bbbc6..dc700d1ea5a42c34fbc10cc42c5bb0372b3b92c5 100644
--- a/app/models/release.rb
+++ b/app/models/release.rb
@@ -3,7 +3,7 @@
 # Table name: releases
 #
 #  id          :integer          not null, primary key
-#  tag         :string(255)
+#  tag         :string
 #  description :text
 #  project_id  :integer
 #  created_at  :datetime
diff --git a/app/models/security_event.rb b/app/models/security_event.rb
index 68c00adad5971078ab1ab5886864accef769995c..0bee03974f14521506935e746de0257cb499f50e 100644
--- a/app/models/security_event.rb
+++ b/app/models/security_event.rb
@@ -4,9 +4,9 @@
 #
 #  id          :integer          not null, primary key
 #  author_id   :integer          not null
-#  type        :string(255)      not null
+#  type        :string           not null
 #  entity_id   :integer          not null
-#  entity_type :string(255)      not null
+#  entity_type :string           not null
 #  details     :text
 #  created_at  :datetime
 #  updated_at  :datetime
diff --git a/app/models/sent_notification.rb b/app/models/sent_notification.rb
index 77115597d71a4e90e422e02c87ba44215307339f..99279a2e083082a3412a41d9181c52e33ad7f404 100644
--- a/app/models/sent_notification.rb
+++ b/app/models/sent_notification.rb
@@ -5,11 +5,11 @@
 #  id            :integer          not null, primary key
 #  project_id    :integer
 #  noteable_id   :integer
-#  noteable_type :string(255)
+#  noteable_type :string
 #  recipient_id  :integer
-#  commit_id     :string(255)
-#  line_code     :string(255)
-#  reply_key     :string(255)      not null
+#  commit_id     :string
+#  reply_key     :string           not null
+#  line_code     :string
 #
 
 class SentNotification < ActiveRecord::Base
diff --git a/app/models/service.rb b/app/models/service.rb
index 2645b8321d722b0bbfd8e686b7340765a7c5b424..bf16a5453071bf8e2faa17dbc23a14fc6e6b19a6 100644
--- a/app/models/service.rb
+++ b/app/models/service.rb
@@ -3,12 +3,12 @@
 # Table name: services
 #
 #  id                    :integer          not null, primary key
-#  type                  :string(255)
-#  title                 :string(255)
+#  type                  :string
+#  title                 :string
 #  project_id            :integer
-#  created_at            :datetime
-#  updated_at            :datetime
-#  active                :boolean          default(FALSE), not null
+#  created_at            :datetime         not null
+#  updated_at            :datetime         not null
+#  active                :boolean          not null
 #  properties            :text
 #  template              :boolean          default(FALSE)
 #  push_events           :boolean          default(TRUE)
@@ -17,6 +17,9 @@
 #  tag_push_events       :boolean          default(TRUE)
 #  note_events           :boolean          default(TRUE), not null
 #  build_events          :boolean          default(FALSE), not null
+#  category              :string           default("common"), not null
+#  default               :boolean          default(FALSE)
+#  wiki_page_events      :boolean          default(TRUE)
 #
 
 # To add new service you should build a class inherited from Service
diff --git a/app/models/snippet.rb b/app/models/snippet.rb
index 0fd080619254fc33a06d04fa88eae6e4dd07f0a3..2f905a90942475fd6042b9c69abf200f6949197e 100644
--- a/app/models/snippet.rb
+++ b/app/models/snippet.rb
@@ -3,14 +3,14 @@
 # Table name: snippets
 #
 #  id               :integer          not null, primary key
-#  title            :string(255)
+#  title            :string
 #  content          :text
 #  author_id        :integer          not null
 #  project_id       :integer
 #  created_at       :datetime
 #  updated_at       :datetime
-#  file_name        :string(255)
-#  type             :string(255)
+#  file_name        :string
+#  type             :string
 #  visibility_level :integer          default(0), not null
 #
 
diff --git a/app/models/spam_log.rb b/app/models/spam_log.rb
index 12df68ef83bf17771b16f079216c9b9fe3cd3a97..f49eb7d88e20e3a4ab3d57be4e517d7ada78bfb1 100644
--- a/app/models/spam_log.rb
+++ b/app/models/spam_log.rb
@@ -1,3 +1,20 @@
+# == Schema Information
+#
+# Table name: spam_logs
+#
+#  id            :integer          not null, primary key
+#  user_id       :integer
+#  source_ip     :string
+#  user_agent    :string
+#  via_api       :boolean
+#  project_id    :integer
+#  noteable_type :string
+#  title         :string
+#  description   :text
+#  created_at    :datetime         not null
+#  updated_at    :datetime         not null
+#
+
 class SpamLog < ActiveRecord::Base
   belongs_to :user
 
diff --git a/app/models/subscription.rb b/app/models/subscription.rb
index dd800ce110fe751a882114417ad888e5c38e5ed5..242faa7d32eb5aa6ba4a40a8fad6eb8d8761bfd6 100644
--- a/app/models/subscription.rb
+++ b/app/models/subscription.rb
@@ -5,7 +5,7 @@
 #  id                :integer          not null, primary key
 #  user_id           :integer
 #  subscribable_id   :integer
-#  subscribable_type :string(255)
+#  subscribable_type :string
 #  subscribed        :boolean
 #  created_at        :datetime
 #  updated_at        :datetime
diff --git a/app/models/user.rb b/app/models/user.rb
index ab48f8f1960d28219bcb6387ffffa8e76490a9bf..959b1f93758ffd7f39358c412b02ee919c149cf3 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -3,55 +3,55 @@
 # Table name: users
 #
 #  id                          :integer          not null, primary key
-#  email                       :string(255)      default(""), not null
-#  encrypted_password          :string(255)      default(""), not null
-#  reset_password_token        :string(255)
+#  email                       :string           default(""), not null
+#  encrypted_password          :string           default(""), not null
+#  reset_password_token        :string
 #  reset_password_sent_at      :datetime
 #  remember_created_at         :datetime
 #  sign_in_count               :integer          default(0)
 #  current_sign_in_at          :datetime
 #  last_sign_in_at             :datetime
-#  current_sign_in_ip          :string(255)
-#  last_sign_in_ip             :string(255)
+#  current_sign_in_ip          :string
+#  last_sign_in_ip             :string
 #  created_at                  :datetime
 #  updated_at                  :datetime
-#  name                        :string(255)
+#  name                        :string
 #  admin                       :boolean          default(FALSE), not null
 #  projects_limit              :integer          default(10)
-#  skype                       :string(255)      default(""), not null
-#  linkedin                    :string(255)      default(""), not null
-#  twitter                     :string(255)      default(""), not null
-#  authentication_token        :string(255)
+#  skype                       :string           default(""), not null
+#  linkedin                    :string           default(""), not null
+#  twitter                     :string           default(""), not null
+#  authentication_token        :string
 #  theme_id                    :integer          default(1), not null
-#  bio                         :string(255)
+#  bio                         :string
 #  failed_attempts             :integer          default(0)
 #  locked_at                   :datetime
-#  username                    :string(255)
+#  username                    :string
 #  can_create_group            :boolean          default(TRUE), not null
 #  can_create_team             :boolean          default(TRUE), not null
-#  state                       :string(255)
+#  state                       :string
 #  color_scheme_id             :integer          default(1), not null
 #  notification_level          :integer          default(1), not null
 #  password_expires_at         :datetime
 #  created_by_id               :integer
 #  last_credential_check_at    :datetime
-#  avatar                      :string(255)
-#  confirmation_token          :string(255)
+#  avatar                      :string
+#  confirmation_token          :string
 #  confirmed_at                :datetime
 #  confirmation_sent_at        :datetime
-#  unconfirmed_email           :string(255)
+#  unconfirmed_email           :string
 #  hide_no_ssh_key             :boolean          default(FALSE)
-#  website_url                 :string(255)      default(""), not null
-#  notification_email          :string(255)
+#  website_url                 :string           default(""), not null
+#  notification_email          :string
 #  hide_no_password            :boolean          default(FALSE)
 #  password_automatically_set  :boolean          default(FALSE)
-#  location                    :string(255)
-#  encrypted_otp_secret        :string(255)
-#  encrypted_otp_secret_iv     :string(255)
-#  encrypted_otp_secret_salt   :string(255)
+#  location                    :string
+#  encrypted_otp_secret        :string
+#  encrypted_otp_secret_iv     :string
+#  encrypted_otp_secret_salt   :string
 #  otp_required_for_login      :boolean          default(FALSE), not null
 #  otp_backup_codes            :text
-#  public_email                :string(255)      default(""), not null
+#  public_email                :string           default(""), not null
 #  dashboard                   :integer          default(0)
 #  project_view                :integer          default(0)
 #  consumed_timestep           :integer
@@ -59,7 +59,8 @@
 #  hide_project_limit          :boolean          default(FALSE)
 #  unlock_token                :string
 #  otp_grace_period_started_at :datetime
-#  external                    :boolean           default(FALSE)
+#  ldap_email                  :boolean          default(FALSE), not null
+#  external                    :boolean          default(FALSE)
 #
 
 require 'carrierwave/orm/activerecord'