Fix schema, it was missing a FK

This commit is contained in:
Jorge Manrubia
2025-06-25 10:37:19 +02:00
parent a4a92a6899
commit eea240193a
4 changed files with 9 additions and 16 deletions
@@ -1,10 +0,0 @@
class CreateSearchEmbeddings < ActiveRecord::Migration[7.1]
def change
create_virtual_table :search_embeddings, :vec0, [
"id INTEGER PRIMARY KEY",
"record_type TEXT NOT NULL",
"record_id INTEGER NOT NULL",
"embedding FLOAT[1536] distance_metric=cosine"
]
end
end
@@ -0,0 +1,5 @@
class DropSearchEmbeddings < ActiveRecord::Migration[8.1]
def change
drop_table :search_embeddings if table_exists?(:search_embeddings)
end
end
@@ -1,5 +0,0 @@
class RemoveSearchEmbeddings < ActiveRecord::Migration[8.1]
def change
drop_table :search_embeddings
end
end
Generated
+4 -1
View File
@@ -304,7 +304,9 @@ ActiveRecord::Schema[8.1].define(version: 2025_06_25_073215) do
t.datetime "created_at", null: false
t.string "terms", limit: 2000, null: false
t.datetime "updated_at", null: false
t.index ["terms"], name: "index_search_queries_on_terms"
t.integer "user_id", null: false
t.index ["user_id", "terms"], name: "index_search_queries_on_user_id_and_terms"
t.index ["user_id"], name: "index_search_queries_on_user_id"
end
create_table "search_results", force: :cascade do |t|
@@ -394,6 +396,7 @@ ActiveRecord::Schema[8.1].define(version: 2025_06_25_073215) do
add_foreign_key "notifications", "users", column: "creator_id"
add_foreign_key "pins", "cards"
add_foreign_key "pins", "users"
add_foreign_key "search_queries", "users"
add_foreign_key "sessions", "users"
add_foreign_key "taggings", "cards"
add_foreign_key "taggings", "tags"