summaryrefslogtreecommitdiff
path: root/spec/migrations/20230131125844_add_project_id_name_id_version_index_to_installable_npm_packages_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/migrations/20230131125844_add_project_id_name_id_version_index_to_installable_npm_packages_spec.rb')
-rw-r--r--spec/migrations/20230131125844_add_project_id_name_id_version_index_to_installable_npm_packages_spec.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/migrations/20230131125844_add_project_id_name_id_version_index_to_installable_npm_packages_spec.rb b/spec/migrations/20230131125844_add_project_id_name_id_version_index_to_installable_npm_packages_spec.rb
new file mode 100644
index 00000000000..5d8c7ab4745
--- /dev/null
+++ b/spec/migrations/20230131125844_add_project_id_name_id_version_index_to_installable_npm_packages_spec.rb
@@ -0,0 +1,20 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+require_migration!
+
+RSpec.describe AddProjectIdNameIdVersionIndexToInstallableNpmPackages, feature_category: :package_registry do
+ it 'schedules an index creation' do
+ reversible_migration do |migration|
+ migration.before -> {
+ expect(ActiveRecord::Base.connection.indexes('packages_packages').map(&:name))
+ .not_to include('idx_packages_on_project_id_name_id_version_when_installable_npm')
+ }
+
+ migration.after -> {
+ expect(ActiveRecord::Base.connection.indexes('packages_packages').map(&:name))
+ .to include('idx_packages_on_project_id_name_id_version_when_installable_npm')
+ }
+ end
+ end
+end