litellm/litellm/proxy/prisma_migration.py
Krish Dholakia f00e891004
LiteLLM SDK <-> Proxy: support user param + Prisma - remove use_prisma_migrate flag - redundant as this is now default (#13555)
* fix(litellm_proxy/chat/transformation.py): support 'user' and all other openai chat completion params

Fixes issue where 'user' was not being sent in request to litellm proxy via sdk

* fix(prisma_migration.py): remove 'use_prisma_migrate' flag, is now default

* docs: cleanup docs

* fix(proxy_cli.py): remove --use_prisma_migrate flag

* refactor: remove references to use_prisma_migrate env var

This is now the default flow for db migrations
2025-08-12 22:03:39 -07:00

29 lines
914 B
Python

# What is this?
## Script to apply initial prisma migration on Docker setup
import os
import subprocess
import sys
sys.path.insert(
0, os.path.abspath("./")
) # Adds the parent directory to the system path
from litellm._logging import verbose_proxy_logger
from litellm.proxy.proxy_cli import run_server
# Call the Click command with standalone_mode=False
run_server(["--skip_server_startup"], standalone_mode=False)
# run prisma generate
verbose_proxy_logger.info("Running 'prisma generate'...")
result = subprocess.run(["prisma", "generate"], capture_output=True, text=True)
verbose_proxy_logger.info(f"'prisma generate' stdout: {result.stdout}") # Log stdout
exit_code = result.returncode
if exit_code != 0:
verbose_proxy_logger.info(f"'prisma generate' failed with exit code {exit_code}.")
verbose_proxy_logger.error(
f"'prisma generate' stderr: {result.stderr}"
) # Log stderr