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

Commit 0a7a376

Browse files
committed
FIX: Split statements to avoid timeout
1 parent 65bbcd7 commit 0a7a376

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

db/migrate/20241230153300_new_embeddings_tables.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,17 @@ def up
6767
end
6868

6969
# Copy data from old tables to new tables
70-
execute <<-SQL
70+
execute <<~SQL
7171
INSERT INTO ai_topics_embeddings (topic_id, model_id, model_version, strategy_id, strategy_version, digest, embeddings, created_at, updated_at)
7272
SELECT * FROM ai_topic_embeddings;
73+
SQL
7374

75+
execute <<~SQL
7476
INSERT INTO ai_posts_embeddings (post_id, model_id, model_version, strategy_id, strategy_version, digest, embeddings, created_at, updated_at)
7577
SELECT * FROM ai_post_embeddings;
78+
SQL
7679

80+
execute <<~SQL
7781
INSERT INTO ai_document_fragments_embeddings (rag_document_fragment_id, model_id, model_version, strategy_id, strategy_version, digest, embeddings, created_at, updated_at)
7882
SELECT * FROM ai_document_fragment_embeddings;
7983
SQL

0 commit comments

Comments
 (0)