gitlab-org--gitlab-foss/lib/gitlab
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
..
auth Fix system hook not firing for blocked users when LDAP sign-in is used 2018-05-12 22:33:29 -07:00
background_migration Backports every CE related change from ee-44542 to CE 2018-05-04 17:33:26 +02:00
badge Change coverage badge rounding for other CI system consistency 2018-02-01 17:40:26 -06:00
bare_repository_import Gitlab::Shell works on shard name, not path 2018-04-25 13:36:22 +02:00
bitbucket_import Use shard name in Git::GitlabProjects instead of shard path 2018-04-03 16:22:13 +02:00
cache Allow rake cache:clear clearing pipeline status cache 2018-04-10 20:57:00 +08:00
checks Add helper for accessing lfs_objects for project 2018-04-05 10:21:51 +02:00
ci Merge branch 'live-trace-v2-efficient-destroy-all' into 'master' 2018-05-07 12:01:32 +00:00
conflict Fix 500 error when trying to resolve non-ASCII conflicts in editor 2018-03-23 18:33:14 +00:00
cross_project_access Port read_cross_project ability from EE 2018-02-22 17:11:36 +01:00
cycle_analytics Adapt cycle analytics spec helper and cycle analytics usage data spec 2018-03-01 16:43:26 +00:00
data_builder Merge branch 'jej/mattermost-notification-confidentiality-10-6' into 'security-10-6' 2018-04-05 08:41:56 +02:00
database [Rails5] Fix Arel::UpdateManager 2018-04-29 12:54:58 +11:00
dependency_linker Enable RuboCop Style/RegexpLiteral 2018-02-01 02:06:07 +09:00
diff Merge branch 'osw-use-cached-highlighted-content-for-discussions' into 'master' 2018-05-01 15:11:21 +00:00
downtime_check
email Backport 5480-epic-notifications from EE 2018-05-07 12:58:47 -06:00
etag_caching Fix flash errors in performance bar for cached responses 2018-04-17 11:50:27 +01:00
fogbugz_import Adds Rubocop rule for line break around conditionals 2018-01-11 16:34:01 +00:00
gfm Resolve "Make a Rubocop that forbids returning from a block" 2018-04-18 09:19:40 +00:00
git Merge branch 'rd-remove-duplicate-method' into 'master' 2018-05-11 18:15:44 +00:00
gitaly_client Remove method call to deprecated method 2018-05-11 08:57:06 +02:00
github_import Backports every CE related change from ee-44542 to CE 2018-05-04 17:33:26 +02:00
gitlab_import Fix provider server URL used when listing repos to import 2018-03-12 16:01:43 -05:00
google_code_import Adds Rubocop rule for line break around conditionals 2018-01-11 16:34:01 +00:00
gpg Fetch commit signatures from Gitaly in batches 2018-03-01 18:31:31 +01:00
grape_logging Save user ID and username in Grape API log (api_json.log) 2018-01-08 21:23:24 -08:00
graphs
health_checks Route path lookups through legacy_disk_path 2018-03-21 18:18:32 +01:00
hook_data Merge branch 'jej/mattermost-notification-confidentiality-10-6' into 'security-10-6' 2018-04-05 08:41:56 +02:00
i18n Only require simple_po_parser in rake task that needs it 2017-09-04 08:30:10 +02:00
import_export Add a unique and not null constraint on the project_features.project_id column 2018-05-15 14:20:14 +02:00
kubernetes Add alpine mirrors while operating on k8s cluster 2018-04-30 15:12:26 +02:00
legacy_github_import Backports every CE related change from ee-44542 to CE 2018-05-04 17:33:26 +02:00
metrics Support resetting of Prometheus metrics between test runs 2018-05-09 14:33:42 -07:00
middleware move dev server middleware to new namespace 2018-05-01 15:15:10 -05:00
performance_bar Fix SQL timings for the performance bar 2017-11-03 15:45:58 +01:00
popen Use Process::Status rather than an integer 2018-01-26 19:42:48 +08:00
project_authorizations
prometheus Fix environment deployment platform filter method 2018-04-06 12:10:30 +02:00
query_limiting Do not count rails sql cache as queries in query limiting 2018-02-21 16:27:05 +11:00
quick_actions Resolve "Milestone Quick Action not displayed with no project milestones but with group milestones" 2018-02-23 14:23:09 +00:00
redis Display and revoke active sessions 2018-05-02 08:08:16 +00:00
request_profiler
sanitizers
serializer
sherlock Enable RuboCop Style/RegexpLiteral 2018-02-01 02:06:07 +09:00
sidekiq_logging Add support for Sidekiq JSON logging 2018-04-04 05:04:00 -07:00
sidekiq_middleware Resolve "Make a Rubocop that forbids returning from a block" 2018-04-18 09:19:40 +00:00
sidekiq_status
sidekiq_versioning Use a dedicated queue for each worker 2017-12-12 17:36:20 +01:00
slash_commands Add slash command for moving an issue 2018-03-15 13:09:11 +00:00
sql Added changelog for user search improvements 2018-02-22 18:55:36 +01:00
storage_check Adds Rubocop rule for line break around conditionals 2018-01-11 16:34:01 +00:00
template Adds Rubocop rule for line break after guard clause 2017-11-16 17:58:29 +01:00
testing Adds Rubocop rule for line break around conditionals 2018-01-11 16:34:01 +00:00
utils Use Gitlab::Utils::Override over defined?(super) 2017-12-26 17:18:10 +08:00
verify Merge remote-tracking branch 'origin/master' into 40781-os-to-ce 2018-03-22 09:06:10 -04:00
view/presenter Resolve "Show failure_reason in jobs view content section" 2018-04-19 07:20:53 +00:00
webpack remove unused methods until needed 2018-05-07 11:20:19 -05:00
access.rb Clarify wording of protected branch settings for the default branch 2017-11-20 16:09:56 +00:00
action_rate_limiter.rb Address review comments with playing pipeline scheduler 2017-12-12 17:12:45 -08:00
allowable.rb
app_logger.rb
asciidoc.rb Set Asciidoctor outfilesuffix to default .adoc 2018-02-14 20:40:47 +00:00
auth.rb Resolve "Make a Rubocop that forbids returning from a block" 2018-04-18 09:19:40 +00:00
background_migration.rb
base_doorkeeper_controller.rb Define custom base controller for Doorkeeper 2018-04-30 11:40:51 +02:00
blame.rb
build_access.rb Allow triggered builds git access 2018-05-11 15:20:11 +02:00
changes_list.rb Adds Rubocop rule for line break after guard clause 2017-11-16 17:58:29 +01:00
chat_name_token.rb
ci_access.rb
closing_issue_extractor.rb Allow creating merge requests across forks of a project 2017-10-07 11:46:23 +02:00
color_schemes.rb
config_helper.rb
contributions_calendar.rb Count discussions on issues and merge requests as contributions for the contributions calendar 2018-03-07 10:16:38 +00:00
contributor.rb
cross_project_access.rb Port read_cross_project ability from EE 2018-02-22 17:11:36 +01:00
current_settings.rb Cache table_exists?('application_settings') to reduce repeated schema reloads 2018-03-15 13:13:00 -07:00
daemon.rb Resolve "Make a Rubocop that forbids returning from a block" 2018-04-18 09:19:40 +00:00
database.rb Cache table_exists?('application_settings') to reduce repeated schema reloads 2018-03-15 13:13:00 -07:00
dependency_linker.rb
downtime_check.rb
ee_compat_check.rb Ignore locale/gitlab.pot in ee_compat_check 2018-04-17 14:25:05 +02:00
emoji.rb Allow simple ivar ||= form. Update accordingly 2017-09-19 01:29:32 +08:00
encoding_helper.rb Fix EncodingHelper#clean blowing up on UTF-16BE strings 2018-03-22 21:22:20 +01:00
environment.rb
environment_logger.rb
exclusive_lease.rb Add rake task to cleanup any existing exclusive lease 2018-03-09 13:32:18 +00:00
fake_application_settings.rb
file_detector.rb Add Repository#xcode_project? method 2018-05-09 18:49:38 +02:00
file_finder.rb API - Include project in commits&blobs search results 2018-02-14 09:00:26 +01:00
git.rb Introduce spec/fast_spec_helper.rb to run spec files that don't rely on the whole Rails env 2018-04-23 12:20:30 +02:00
git_access.rb Allow triggered builds git access 2018-05-11 15:20:11 +02:00
git_access_wiki.rb Fix repo existence check in GitAccessWiki 2018-02-22 00:20:30 +00:00
git_logger.rb
git_post_receive.rb
git_ref_validator.rb Prevent branches or tags from starting with invalid characters (e.g. -, .) 2017-10-05 14:56:36 -07:00
gitaly_client.rb Test if remote repository exists before cloning 2018-03-27 14:43:21 +02:00
github_import.rb Rename fetch_refs to refmap 2017-11-23 16:59:58 +01:00
gl_id.rb Fix Custom hooks are not triggered by UI wiki edit 2018-04-18 17:50:56 +00:00
gl_repository.rb
gon_helper.rb Optimize Emoji Sprite Handling 2018-05-02 18:23:17 +00:00
gpg.rb Address feedback from last code review 2017-10-05 08:25:27 -05:00
group_hierarchy.rb Reuse base_and_ancestors for ancestors in GroupHierarchy 2017-10-10 16:55:02 +02:00
highlight.rb
http.rb Raise more descriptive errors when URLs are blocked 2018-04-02 17:20:01 +02:00
i18n.rb Add Turkish, Filipino and Indonesian 2018-03-05 21:26:42 +01:00
identifier.rb Allow git pull/push on project redirects 2017-12-08 17:42:43 +00:00
import_export.rb Cleanup after adding MR diff's commit_count (try 2) 2018-04-25 10:53:37 +02:00
import_formatter.rb
import_sources.rb add note to import sources 2018-01-03 09:31:32 +01:00
incoming_email.rb
insecure_key_fingerprint.rb Backport authorized_keys branch 'find-key-by-fingerprint' 2018-01-08 20:34:16 +00:00
issuable_metadata.rb Fail when issuable_meta_data is called on an unlimited collection 2017-11-07 16:26:55 +00:00
issuable_sorter.rb
issuables_count_for_state.rb Re-use issue/MR counts for the pagination system 2017-09-05 11:53:45 +02:00
issues_labels.rb
job_waiter.rb Extract WaitableWorker out of AuthorizedProjectsWorker 2018-02-26 13:25:58 +01:00
kubernetes.rb Fix broken certificate-authority-data with kubectl >= 1.8.0 2017-10-03 09:10:40 +02:00
lazy.rb
lfs_token.rb Fix Error 500 when pushing LFS objects with a write deploy key 2017-11-08 16:21:39 +00:00
logger.rb Memoize GitLab logger to reduce open file descriptors 2017-10-24 14:06:23 +03:00
mail_room.rb Decrease Cyclomatic Complexity threshold to 13 2017-09-12 17:02:11 +00:00
markup_helper.rb
metrics.rb Convert InfluxDB to concern. Fix uninitialized metrics when metrics code is inherited. 2018-01-29 15:13:04 +01:00
multi_collection_paginator.rb [Rails5] Fix per_page in lib/gitlab/multi_collection_paginator.rb 2018-05-11 13:36:38 +11:00
omniauth_initializer.rb OmniauthInitializer refactoring 2018-03-22 00:24:53 +00:00
optimistic_locking.rb Resolve "Make a Rubocop that forbids returning from a block" 2018-04-18 09:19:40 +00:00
other_markup.rb
otp_key_rotator.rb
pages.rb Add GitLab-Pages version to Admin Dashboard 2017-09-07 22:02:57 -05:00
pages_client.rb Add gitlab-pages admin ping rake task 2018-04-27 11:01:54 +00:00
pages_transfer.rb
path_regex.rb Merge branch 'master' into '26388-push-to-create-a-new-project' 2018-02-06 19:14:43 +00:00
performance_bar.rb Always allow the performance bar to be enabled for admins 2018-04-02 14:19:19 -05:00
plugin.rb Refactor plugins feature and make some doc improvements 2018-02-28 12:16:23 +02:00
plugin_logger.rb Remove trailing line from plugin logger 2018-02-28 13:17:44 +02:00
polling_interval.rb use Gitlab::UserSettings directly as a singleton instead of including/extending it 2018-02-02 18:39:55 +00:00
popen.rb Use Process::Status rather than an integer 2018-01-26 19:42:48 +08:00
profiler.rb Add query counts by model to profiler output 2018-03-21 17:18:33 +00:00
project_search_results.rb Disable greedy mode when matching filename 2018-05-15 10:20:18 +00:00
project_template.rb Resolve "Reconcile project templates with Auto DevOps" 2018-05-04 09:48:53 +00:00
project_transfer.rb Fix moving local files during namespace transfer 2018-03-13 14:45:17 -07:00
prometheus_client.rb Squashed commit of the following: 2018-02-24 00:15:12 +01:00
protocol_access.rb use Gitlab::UserSettings directly as a singleton instead of including/extending it 2018-02-02 18:39:55 +00:00
proxy_http_connection_adapter.rb Rename allow_private_networks to allow_local_network 2018-04-02 17:24:19 +02:00
query_limiting.rb Disable query limiting warnings for now on GitLab.com 2018-02-12 11:41:03 -08:00
recaptcha.rb use Gitlab::UserSettings directly as a singleton instead of including/extending it 2018-02-02 18:39:55 +00:00
reference_counter.rb Implement /internal/post_receive unified endpoint for PostReceive tasks 2017-08-31 11:31:45 -03:00
reference_extractor.rb Refactor banzai to support referencing from group context 2017-12-06 19:16:22 +01:00
regex.rb Ensure users can't create environments with leading or trailing slashes (Fixes #39885) 2018-02-13 11:07:12 +11:00
repo_path.rb Remove Gitlab::RepoPath.strip_storage_path 2018-05-11 13:57:43 +02:00
repository_cache.rb Cache #can_be_resolved_in_ui? git operations 2018-03-08 11:54:21 -03:00
repository_cache_adapter.rb Refactor RepositoryCache to make it usable in other classes 2018-03-06 21:12:29 -03:00
repository_check_logger.rb
request_context.rb
request_forgery_protection.rb
request_profiler.rb
route_map.rb
routing.rb Don't add a trailing slash in group redirects 2017-11-16 17:13:40 +00:00
search_results.rb Fix code and wiki search results when filename is non-ASCII 2018-03-12 10:43:13 +00:00
seeder.rb Mute notifications in the seeder to speed GDK development 2018-01-26 15:25:05 -08:00
sentry.rb Method to track recoverable exceptions in sentry 2018-04-17 11:39:23 +02:00
setup_helper.rb Route path lookups through legacy_disk_path 2018-03-21 18:18:32 +01:00
shell.rb Remove old GitLab Shell implementation 2018-05-02 11:54:43 +02:00
shell_adapter.rb Memoize GitlabShellAdapter for performance and ease of testing 2017-11-20 23:28:49 -08:00
sherlock.rb
sidekiq_config.rb Use a dedicated queue for each worker 2017-12-12 17:36:20 +01:00
sidekiq_logger.rb
sidekiq_status.rb Simplify check for running job on Redis 2017-10-13 10:17:41 +02:00
sidekiq_throttler.rb
sidekiq_versioning.rb Use a dedicated queue for each worker 2017-12-12 17:36:20 +01:00
snippet_search_results.rb Return only limited pagination headers for search API endpoints 2018-02-06 17:58:18 +01:00
ssh_public_key.rb Validate SSH keys through the sshkey gem 2018-02-16 11:32:08 -05:00
storage_check.rb Move the circuitbreaker check out in a separate process 2017-12-08 09:11:39 +01:00
string_placeholder_replacer.rb Projects and groups badges API 2018-03-05 17:51:40 +00:00
string_range_marker.rb Render htmlentities correctly for links not supported by Rinku 2018-02-21 19:37:08 +01:00
string_regex_marker.rb Render htmlentities correctly for links not supported by Rinku 2018-02-21 19:37:08 +01:00
task_helpers.rb Route path lookups through legacy_disk_path 2018-03-21 18:18:32 +01:00
tcp_checker.rb Add a gitlab:tcp_check rake task 2017-12-13 15:53:32 +00:00
themes.rb Allow simple ivar ||= form. Update accordingly 2017-09-19 01:29:32 +08:00
time_tracking_formatter.rb
timeless.rb Adds Rubocop rule for line break around conditionals 2018-01-11 16:34:01 +00:00
untrusted_regexp.rb Backport EE-specific untrusted regexp implementation 2018-05-14 10:43:45 +02:00
update_path_error.rb
upgrader.rb Enable RuboCop Style/RegexpLiteral 2018-02-01 02:06:07 +09:00
uploads_transfer.rb Revert "Merge branch '3867-port-to-ce' into 'master'" 2018-02-28 21:09:34 +01:00
url_blocker.rb Rename allow_private_networks to allow_local_network 2018-04-02 17:24:19 +02:00
url_builder.rb
url_sanitizer.rb Adds Rubocop rule for line break after guard clause 2017-11-16 17:58:29 +01:00
usage_data.rb Backports every CE related change from ee-5484 to CE 2018-05-07 11:59:51 +02:00
user_access.rb Allow admins to push to empty repos 2018-04-24 14:06:59 +02:00
user_activities.rb
utils.rb Backport of EE !4989 2018-04-11 22:05:07 -05:00
version_info.rb
visibility_level.rb Merge branch 'bvl-fix-500-on-fork-without-restricted-visibility-levels' into 'master' 2018-02-02 19:12:55 +00:00
workhorse.rb Add an API endpoint to download git repository snapshots 2018-04-19 17:25:01 +01:00