gitlab-org--gitlab-foss/spec
Stan Hu 1b06377812 Prevent EE backport migrations from running if CE is not migrated
If a user upgraded to any GitLab 11.x EE version but switched
back to CE, it's possible the state of the EE tables are not
in the right state for the EE backport migration to work properly.
In particular, there were three tables that had trouble:

* epics
* geo_event_log
* vulnerability_feedback

The EE backport migration would fail while trying to add foreign key
constraints because a key didn't exist in the table. This happens
because any EE migration that add or removed columns between v11.0.0 and
v11.11.3 are not guaranteed to be applied in an CE installation. The EE
backport schema does not individually backport these migrations.

We now check if certain columns are present to determine whether
the backport migration is in the proper state. CE users are required
to upgrade to v11.11.3 EE if they ever installed EE previously before
they can go back to v12.x CE.

Tested via:

```
git checkout -f v11.0.0-ee
bundle exec rake db:reset
git checkout .; git checkout -f v11.11.3
bundle exec rake db:migrate
git checkout .; git checkout -f v12.0.0
bundle exec rake db:migrate
<failure happens>
```
2019-06-25 05:42:10 -07:00
..
bin
config
controllers Eliminate N+1 queries in Dashboard::TodosController 2019-06-24 09:57:38 -07:00
db Backport the EE schema and migrations to CE 2019-06-17 17:09:05 +02:00
dependencies
factories Renew Let's Encrypt certificates 2019-06-24 20:35:12 +00:00
features Merge branch 'search-blob-basenames' into 'master' 2019-06-24 12:23:35 +00:00
finders Return all runner tags when search is empty 2019-06-24 16:44:04 +03:00
fixtures Add embedding flag and filter to CPU/Mem 2019-06-20 14:06:18 +00:00
frontend Render branch divergance graph with Vue 2019-06-24 12:52:00 +01:00
graphql Render GFM html in GraphQL 2019-06-20 08:02:33 +00:00
haml_lint/linter
helpers Memoize non-existent custom appearances 2019-06-23 14:38:44 -07:00
initializers
javascripts Merge branch 'jivanvl-add-column-chart-monitoring-dashboard' into 'master' 2019-06-24 16:45:16 +00:00
lib Revert "Merge branch..." 2019-06-24 17:29:54 +00:00
mailers Fix notes email with group-level notification email 2019-06-24 09:20:10 +00:00
migrations Prevent EE backport migrations from running if CE is not migrated 2019-06-25 05:42:10 -07:00
models Renew Let's Encrypt certificates 2019-06-24 20:35:12 +00:00
policies Add documentation and tests 2019-06-19 07:08:56 +00:00
presenters
rack_servers
requests Add name & search parameters to project environments API 2019-06-24 12:18:40 +00:00
routing Remove deprecated group routes 2019-06-14 20:36:19 +03:00
rubocop
serializers Omit issues links in merge request entity API response 2019-06-20 15:59:41 -07:00
services Merge branch 'sync-merge-ref-upon-mergeability-check' into 'master' 2019-06-24 09:31:46 +00:00
sidekiq/cron
support Revert "Merge branch..." 2019-06-24 17:29:54 +00:00
tasks Sanitize LDAP output in Rake tasks 2019-06-21 05:49:56 -05:00
uploaders
validators
views Merge branch 'error-pipelines-for-blocked-users' into 'master' 2019-06-17 13:00:34 +00:00
workers Renew Let's Encrypt certificates 2019-06-24 20:35:12 +00:00
factories_spec.rb
fast_spec_helper.rb Backport gitlab.yml.example from EE 2019-06-20 14:51:49 +02:00
rails_helper.rb
rake_helper.rb
simplecov_env.rb
spec_helper.rb