Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.

Commit 2b1ec5b

Browse files
committed
DEV: Fix mismatched column types in tests
The primary key is usually a bigint column, but the foreign key columns usually are of integer type. This can lead to issues when joining these columns due to mismatched types and different value ranges. In a recent core change, all bigint sequences will start at a very high value in the test environment to surface this type of errors. The same change also added a temporary API that changes the column type to bigint in order to allow for the tests to run. The plugin API is only temporary and it is important for these plugins to migrate their columns to bigint to avoid issues in the future.
1 parent e1a0eb6 commit 2b1ec5b

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

spec/plugin_helper.rb

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,14 @@ def assign_fake_provider_to(setting_name)
1414
end
1515
end
1616

17-
RSpec.configure { |c| c.include DiscourseAi::ChatBotHelper }
17+
RSpec.configure do |config|
18+
config.include DiscourseAi::ChatBotHelper
19+
20+
config.before(:suite) do
21+
if defined?(migrate_column_to_bigint)
22+
migrate_column_to_bigint(RagDocumentFragment, :target_id)
23+
migrate_column_to_bigint("ai_document_fragment_embeddings", "rag_document_fragment_id")
24+
migrate_column_to_bigint(ClassificationResult, :target_id)
25+
end
26+
end
27+
end

0 commit comments

Comments
 (0)