db_vector_välja_muutmine.sh 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. # Veeru laiuse muudatus
  2. docker exec -it postgres_postgis bash -c "
  3. export PGPASSWORD='osm' &&
  4. psql -U osm -h localhost -d pdf_research -c \"
  5. ALTER TABLE chunks
  6. ALTER COLUMN embedding TYPE vector(384);
  7. \"
  8. "
  9. docker exec -it postgres_postgis bash -c "
  10. export PGPASSWORD='osm' &&
  11. psql -U osm -h localhost -d pdf_research -c \"
  12. DROP INDEX IF EXISTS idx_chunks_embedding;
  13. CREATE INDEX idx_chunks_embedding ON chunks
  14. USING ivfflat (embedding vector_cosine_ops) WITH (lists = 100);
  15. \"
  16. "
  17. # Lisa raw_documents tabelisse weaviate_article_id veerg
  18. docker exec -it postgres_postgis bash -c "
  19. export PGPASSWORD='osm' &&
  20. psql -U osm -h localhost -d pdf_research -c \"
  21. ALTER TABLE raw_documents ADD COLUMN weaviate_article_id UUID;
  22. CREATE INDEX idx_raw_weaviate_id ON raw_documents(weaviate_article_id);
  23. \"
  24. "
  25. # Kontrollli veeru olemasolu
  26. docker exec -it postgres_postgis bash -c "
  27. export PGPASSWORD='osm' &&
  28. psql -U osm -h localhost -d pdf_research -c \"
  29. SELECT column_name, data_type FROM information_schema.columns WHERE table_name = 'raw_documents' ORDER BY ordinal_position;
  30. \"
  31. "