Skip to content

~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.

Delete scripts/create_unified_library_tables.py

LearningCircuit5c46491e9cbf
diff --git a/scripts/create_unified_library_tables.py b/scripts/create_unified_library_tables.py
deleted file mode 100644
index 3e0b66bfe7..0000000000
--- a/scripts/create_unified_library_tables.py
+++ /dev/null
@@ -1,85 +0,0 @@
-#!/usr/bin/env python3
-"""
-Create new unified library tables in the database.
-Run this script to add the tables for the unified document architecture.
-"""
-
-import sys
-from pathlib import Path
-
-# Add src to path
-sys.path.insert(0, str(Path(__file__).parent.parent / "src"))
-
-from local_deep_research.database.models.library import (
- SourceType,
- UploadBatch,
- Document,
- Collection,
- DocumentCollection,
- DownloadQueue,
-)
-from local_deep_research.database.session_context import get_user_db_session
-from local_deep_research.database.library_init import initialize_library_for_user
-from loguru import logger
-
-
-def create_unified_library_tables(username: str):
- """Create unified library tables for a user."""
- logger.info(f"Creating unified library tables for user: {username}")
-
- try:
- with get_user_db_session(username) as session:
- connection = session.connection()
-
- # Create tables if they don't exist
- logger.info("Creating source_types table...")
- SourceType.__table__.create(bind=connection, checkfirst=True)
-
- logger.info("Creating upload_batches table...")
- UploadBatch.__table__.create(bind=connection, checkfirst=True)
-
- logger.info("Creating documents table...")
- Document.__table__.create(bind=connection, checkfirst=True)
-
- logger.info("Creating collections table...")
- Collection.__table__.create(bind=connection, checkfirst=True)
-
- logger.info("Creating document_collections junction table...")
- DocumentCollection.__table__.create(bind=connection, checkfirst=True)
-
- logger.info("Creating download_queue table...")
- DownloadQueue.__table__.create(bind=connection, checkfirst=True)
-
- # Commit the DDL changes
- session.commit()
-
- logger.info("✓ Unified library tables created successfully!")
-
- # Initialize source types and default Library collection
- logger.info("Initializing library system (source types + default collection)...")
- init_results = initialize_library_for_user(username)
-
- if init_results.get("success"):
- logger.info(f"✓ Library system initialized!")
- logger.info(f" - Source types seeded: {init_results.get('source_types_seeded')}")
- logger.info(f" - Library collection ID: {init_results.get('library_collection_id')}")
- else:
- logger.error(f"✗ Library initialization failed: {init_results.get('error')}")
- return False
-
- return True
-
- except Exception as e:
- logger.exception(f"✗ Failed to create tables: {e}")
- return False
-
-
-if __name__ == "__main__":
- if len(sys.argv) < 2:
- print("Usage: python create_unified_library_tables.py <username>")
- print("Example: python create_unified_library_tables.py a0006")
- sys.exit(1)
-
- username = sys.argv[1]
- success = create_unified_library_tables(username)
- sys.exit(0 if success else 1)