mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 10:44:24 +00:00
Litellm expose disable schema update flag (#6085)
* fix: enable new 'disable_prisma_schema_update' flag * build(config.yml): remove setup remote docker step * ci(config.yml): give container time to start up * ci(config.yml): update test * build(config.yml): actually start docker * build(config.yml): simplify grep check * fix(prisma_client.py): support reading disable_schema_update via env vars * ci(config.yml): add test to check if all general settings are documented * build(test_General_settings.py): check available dir * ci: check ../ repo path * build: check ./ * build: fix test
This commit is contained in:
parent
f2c0a31e3c
commit
04e5963b65
11 changed files with 598 additions and 44 deletions
|
@ -1055,27 +1055,7 @@ class PrismaClient:
|
|||
try:
|
||||
from prisma import Prisma # type: ignore
|
||||
except Exception:
|
||||
os.environ["DATABASE_URL"] = database_url
|
||||
# Save the current working directory
|
||||
original_dir = os.getcwd()
|
||||
# set the working directory to where this script is
|
||||
abspath = os.path.abspath(__file__)
|
||||
dname = os.path.dirname(abspath)
|
||||
os.chdir(dname)
|
||||
|
||||
try:
|
||||
subprocess.run(["prisma", "generate"])
|
||||
subprocess.run(
|
||||
["prisma", "db", "push", "--accept-data-loss"]
|
||||
) # this looks like a weird edge case when prisma just wont start on render. we need to have the --accept-data-loss
|
||||
except Exception as e:
|
||||
raise Exception(
|
||||
f"Unable to run prisma commands. Run `pip install prisma` Got Exception: {(str(e))}"
|
||||
)
|
||||
finally:
|
||||
os.chdir(original_dir)
|
||||
# Now you can import the Prisma Client
|
||||
from prisma import Prisma # type: ignore
|
||||
raise Exception("Unable to find Prisma binaries.")
|
||||
verbose_proxy_logger.debug("Connecting Prisma Client to DB..")
|
||||
if http_client is not None:
|
||||
self.db = PrismaWrapper(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue