FIX: Missing table check in post_migration (#1068)
This commit is contained in:
parent
65456c8b30
commit
cd03874b4d
|
@ -1,6 +1,7 @@
|
|||
# frozen_string_literal: true
|
||||
class DropOldEmbeddingTables2 < ActiveRecord::Migration[7.2]
|
||||
def up
|
||||
if table_exists?(:ai_document_fragment_embeddings)
|
||||
# Copy rag embeddings created during deploy.
|
||||
execute <<~SQL
|
||||
INSERT INTO ai_document_fragments_embeddings (rag_document_fragment_id, model_id, model_version, strategy_id, strategy_version, digest, embeddings, created_at, updated_at)
|
||||
|
@ -15,6 +16,7 @@ class DropOldEmbeddingTables2 < ActiveRecord::Migration[7.2]
|
|||
WHERE target.rag_document_fragment_id IS NULL
|
||||
)
|
||||
SQL
|
||||
end
|
||||
|
||||
execute <<~SQL
|
||||
DROP INDEX IF EXISTS ai_topic_embeddings_1_1_search_bit;
|
||||
|
|
Loading…
Reference in New Issue