gitlab-org--gitlab-foss/lib/gitlab/import_export
Stan Hu 3126e89eb8
Add a unique and not null constraint on the project_features.project_id column
This commit has two migrations:

1. The first prunes duplicate rows in the project_features table and leaves
   the row with the highest ID.  Since the behavior was indeterministic before
   and depended on which row the database decided to use, this change at least
   makes the permissions consistent. For example, in some cases, the Wiki may
   have been disabled but enabled in another entry.

2. The second adds a non-null constraint on the project_features.project_id
   column.

Closes #37882

Fixes a significant part of gitlab-com/migration#408.

We found that we were overcounting Wikis because of these duplicates.
On GitLab.com, there are 56 rows with duplicate entries by project_id, and 16,661 rows with NULL project_id values.
2018-05-15 14:20:14 +02:00
..
after_export_strategies Extend API for exporting a project with direct upload URL 2018-03-30 15:45:59 +00:00
after_export_strategy_builder.rb Extend API for exporting a project with direct upload URL 2018-03-30 15:45:59 +00:00
attribute_cleaner.rb
attributes_finder.rb Fix two additional violations caused by previous changes 2017-08-15 15:53:16 -04:00
avatar_restorer.rb
avatar_saver.rb
command_line_util.rb Migrate restoring repo from bundle to Gitaly 2018-01-24 19:02:32 +01:00
error.rb
file_importer.rb Enable RuboCop Style/RegexpLiteral 2018-02-01 02:06:07 +09:00
hash_util.rb
import_export.yml Backports every CE related change from ee-5484 to CE 2018-05-07 11:59:51 +02:00
importer.rb Extend API for importing a project export with overwrite support 2018-04-06 15:23:49 +00:00
json_hash_builder.rb Add table for files in merge request diffs 2017-06-16 18:30:01 +01:00
lfs_restorer.rb Add helper for accessing lfs_objects for project 2018-04-05 10:21:51 +02:00
lfs_saver.rb Add helper for accessing lfs_objects for project 2018-04-05 10:21:51 +02:00
members_mapper.rb
merge_request_parser.rb Clean up schema of the "merge_requests" table 2017-11-20 12:45:33 +01:00
project_tree_restorer.rb Extend API for importing a project export with overwrite support 2018-04-06 15:23:49 +00:00
project_tree_saver.rb Adds the option to override project description on export via API 2018-03-16 13:56:11 +00:00
reader.rb fix export performance of CI builds 2017-09-05 17:47:45 +02:00
relation_factory.rb Add a unique and not null constraint on the project_features.project_id column 2018-05-15 14:20:14 +02:00
repo_restorer.rb Migrate restoring repo from bundle to Gitaly 2018-01-24 19:02:32 +01:00
repo_saver.rb Migrate repository bundling to Gitaly 2018-01-24 12:10:31 +01:00
saver.rb Merge branch 'fix/import-rce-10-3' into 'security-10-3' 2018-01-16 17:04:51 -08:00
shared.rb Extend API for exporting a project with direct upload URL 2018-03-30 15:45:59 +00:00
statistics_restorer.rb Extend API for importing a project export with overwrite support 2018-04-06 15:23:49 +00:00
uploads_restorer.rb
uploads_saver.rb port of 594e6a0a625^..f74c90f68c6 2018-02-01 12:14:46 -05:00
version_checker.rb
version_saver.rb
wiki_repo_saver.rb Migrate repository bundling to Gitaly 2018-01-24 12:10:31 +01:00
wiki_restorer.rb Create an empty wiki when there is no wiki in the gitlab export bundle 2018-02-12 15:38:10 +00:00