mirror of
https://github.com/discourse/discourse-ai.git
synced 2025-06-28 18:42:16 +00:00
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
|
# frozen_string_literal: true
|
||||||
class DropOldEmbeddingTables2 < ActiveRecord::Migration[7.2]
|
class DropOldEmbeddingTables2 < ActiveRecord::Migration[7.2]
|
||||||
def up
|
def up
|
||||||
|
if table_exists?(:ai_document_fragment_embeddings)
|
||||||
# Copy rag embeddings created during deploy.
|
# Copy rag embeddings created during deploy.
|
||||||
execute <<~SQL
|
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)
|
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
|
WHERE target.rag_document_fragment_id IS NULL
|
||||||
)
|
)
|
||||||
SQL
|
SQL
|
||||||
|
end
|
||||||
|
|
||||||
execute <<~SQL
|
execute <<~SQL
|
||||||
DROP INDEX IF EXISTS ai_topic_embeddings_1_1_search_bit;
|
DROP INDEX IF EXISTS ai_topic_embeddings_1_1_search_bit;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user