gitlab-org--gitlab-foss/spec/models
Douwe Maan 05efd19e89 Merge branch 'dz-nested-groups' into 'master'
Add nested groups support on data level

## What does this MR do?

- [x] Add  `parent_id` field to `Namespace`model. 
- [x] Create new database table `routes` that keeps information about full path to each group or project
- [x] Remove uniq index from `namespaces.path`
- [x] Add uniq index on `routes.path`
- [x] Fill routes table with path data from namespaces and projects
- [x] Change Namespace/Project URL lookup by routes table
- [x] Rename related routes (nested groups, projects) when parent path changes

This is solely backend preparation. UI, Permissions and API support will be added in separate merge request.   
 
## Are there points in the code the reviewer needs to double check?

migrations, Route model, Routable concern

Will require downtime. See https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7121#note_19490281 discussion

## Why was this MR needed?

One step further to full nested groups support

## Screenshots (if relevant)

No UI changes in this merge request so far

## Does this MR meet the acceptance criteria?

- [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG.md) entry added~~
- ~~[Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)~~
- ~~API support added~~
- Tests
  - [x] Added for this feature/bug
  - [x] All builds are passing
- [x] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html)
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] Branch has no merge conflicts with `master` (if it does - rebase it please)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)

## What are the relevant issue numbers?

https://gitlab.com/gitlab-org/gitlab-ce/issues/2772

See merge request !7121
2016-12-09 01:52:36 +00:00
..
ci Merge branch 'pipeline-stage' into 'master' 2016-12-08 15:59:49 +00:00
concerns Merge branch 'dz-nested-groups' into 'master' 2016-12-09 01:52:36 +00:00
cycle_analytics Merge branch 'jej-fix-missing-access-check-on-issues' into 'security' 2016-11-28 21:25:46 -03:00
hooks
issue Add a be_like_time matcher and use it in specs 2016-10-17 14:44:20 +01:00
members Optimize Event queries by removing default order 2016-10-27 20:07:11 -03:00
merge_request Add a be_like_time matcher and use it in specs 2016-10-17 14:44:20 +01:00
network
project_services Merge branch 'rs-include-emailhelpers' into 'master' 2016-12-01 10:46:40 +00:00
ability_spec.rb
abuse_report_spec.rb
appearance_spec.rb
application_setting_spec.rb Refine Git garbage collection 2016-11-04 14:30:11 +01:00
award_emoji_spec.rb
blob_spec.rb
board_spec.rb
broadcast_message_spec.rb Use build instead create in BroadcastMessage model spec 2016-11-19 03:22:02 +05:00
build_spec.rb Replace references to MergeRequestDiff#commits with st_commits 2016-12-01 12:17:30 +01:00
chat_name_spec.rb Add most of specs for chat names 2016-11-17 21:34:23 +01:00
commit_range_spec.rb Merge branch 'jej-23867-use-mr-finder-instead-of-access-check' into 'security' 2016-12-08 21:42:07 -03:00
commit_spec.rb Merge branch 'jej-23867-use-mr-finder-instead-of-access-check' into 'security' 2016-12-08 21:42:07 -03:00
commit_status_spec.rb Fix handling of allowed to failure jobs 2016-12-06 14:13:21 +01:00
compare_spec.rb
deploy_key_spec.rb
deploy_keys_project_spec.rb
deployment_spec.rb Work on specs 2016-10-17 17:10:26 +02:00
diff_note_spec.rb
discussion_spec.rb Feature: delegate all open discussions to Issue 2016-12-05 20:55:45 +01:00
email_spec.rb refactor(email): use setter method instead AR callbacks 2016-10-23 17:30:07 +05:00
environment_spec.rb Use :maximum instead of :within for length validators with a 0..N range 2016-12-06 10:23:17 +01:00
event_spec.rb Removed data-user-is view code 2016-11-25 13:45:34 +01:00
external_issue_spec.rb Add the method ExternalIssue#project_id 2016-11-07 12:49:24 +01:00
forked_project_link_spec.rb
generic_commit_status_spec.rb
global_milestone_spec.rb
group_label_spec.rb Add shorthand support to gitlab markdown references 2016-12-02 19:18:17 -02:00
group_spec.rb Make access request specs explicitly enable or disable access requests as required 2016-11-11 15:45:47 +00:00
guest_spec.rb Merge branch 'fix-unathorized-cloning' into 'security' 2016-11-09 12:27:17 +01:00
identity_spec.rb
issue_collection_spec.rb Process commits in a separate worker 2016-11-07 13:11:44 +01:00
issue_spec.rb Add shorthand support to gitlab markdown references 2016-12-02 19:18:17 -02:00
key_spec.rb Use :maximum instead of :within for length validators with a 0..N range 2016-12-06 10:23:17 +01:00
label_link_spec.rb
label_priority_spec.rb Add support to group labels prioritization on project level 2016-10-19 14:58:27 -02:00
label_spec.rb Abstract LabelPriority away into methods on Label model 2016-10-19 14:58:27 -02:00
legacy_diff_note_spec.rb
list_spec.rb
member_spec.rb Precalculate user's authorized projects in database 2016-11-18 20:25:45 +02:00
merge_request_diff_spec.rb Replace references to MergeRequestDiff#commits with st_commits 2016-12-01 12:17:30 +01:00
merge_request_spec.rb Merge branch '23589-open-issue-for-mr' into 'master' 2016-12-06 14:04:14 +00:00
milestone_spec.rb Add shorthand support to gitlab markdown references 2016-12-02 19:18:17 -02:00
namespace_spec.rb Merge branch 'dz-nested-groups' into 'master' 2016-12-09 01:52:36 +00:00
note_spec.rb Rephrase some system notes to be compatible with new system note style 2016-11-24 18:26:29 +08:00
notification_setting_spec.rb
personal_access_token_spec.rb
project_feature_spec.rb Add visibility level to project repository 2016-10-17 18:12:18 -02:00
project_group_link_spec.rb Precalculate user's authorized projects in database 2016-11-18 20:25:45 +02:00
project_label_spec.rb Add shorthand support to gitlab markdown references 2016-12-02 19:18:17 -02:00
project_snippet_spec.rb
project_spec.rb Merge branch 'dz-nested-groups' into 'master' 2016-12-09 01:52:36 +00:00
project_team_spec.rb Update ProjectTeam#fetch_members to use project authorizations 2016-11-23 12:59:13 +02:00
project_wiki_spec.rb
protected_branch_spec.rb
release_spec.rb
repository_spec.rb Update outdated visible content spec descriptions 2016-12-07 11:31:01 +01:00
route_spec.rb Add nested groups support on data level 2016-12-08 11:47:16 +02:00
service_spec.rb Remove empty describe block in service spec 2016-11-22 21:27:16 +05:00
snippet_spec.rb Merge branch '25209-improve-length-validators' into 'master' 2016-12-07 10:31:21 +00:00
spam_log_spec.rb
subscription_spec.rb Allow subscriptions to be created without a project 2016-11-17 15:10:13 -02:00
todo_spec.rb
tree_spec.rb
trending_project_spec.rb
user_agent_detail_spec.rb
user_spec.rb Merge branch '25209-improve-length-validators' into 'master' 2016-12-07 10:31:21 +00:00
wiki_page_spec.rb