BigW Consortium Gitlab

20170412174900_rename_reserved_dynamic_paths.rb 1.08 KB
Newer Older
1 2 3 4
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.

class RenameReservedDynamicPaths < ActiveRecord::Migration
5
  include Gitlab::Database::RenameReservedPathsMigration::V1
6 7 8 9 10 11

  DOWNTIME = false

  disable_ddl_transaction!

  DISALLOWED_ROOT_PATHS = %w[
12 13
    -
    abuse_reports
14 15 16
    api
    autocomplete
    explore
17
    health_check
18 19 20
    import
    invites
    jwt
21 22 23
    koding
    member
    notification_settings
24 25
    oauth
    sent_notifications
26
    unicorn_test
27
    uploads
28
    users
29 30
  ]

31 32 33 34 35
  DISALLOWED_WILDCARD_PATHS = %w[
    environments/folders
    gitlab-lfs/objects
    info/lfs/objects
  ]
36

37 38
  DISSALLOWED_GROUP_PATHS = %w[
    activity
39 40
    analytics
    audit_events
41 42
    avatar
    group_members
43
    hooks
44
    labels
45 46
    ldap
    ldap_group_links
47
    milestones
48 49
    notification_setting
    pipeline_quota
50 51 52
    subgroups
  ]

53 54 55
  def up
    rename_root_paths(DISALLOWED_ROOT_PATHS)
    rename_wildcard_paths(DISALLOWED_WILDCARD_PATHS)
56
    rename_child_paths(DISSALLOWED_GROUP_PATHS)
57 58 59 60 61 62
  end

  def down
    # nothing to do
  end
end