we are creating django api with docker
when i created the test db and ran tests all was good
i have decided to create the db with a non default ‘public’ schema
now when i try and run test, they fail because the schema is missing in the test database
how to get this working?
This is a Docker forum, it’s about containers. You are asking a specific question about a database, which will probably behave similar with and without container. So you should probably ask in a dedicated database forum instead.
apologies i wasn’t sure if it was a docker centric issue
this is my command
docker compose run --rm app python manage.py test --noinput
You are asking for database help in a container forum and don’t even provide any database image info?
DATABASES = {
"default": {
"ENGINE": "django.db.backends.postgresql",
#"ENGINE": "app.db_backends.postgresql",
"HOST": os.environ.get("DB_HOST"),
"NAME": os.environ.get("DB_NAME"),
"USER": os.environ.get("DB_USER"),
"PASSWORD": os.environ.get("DB_PASS"),
"PORT": os.environ.get("DB_PORT"),
"OPTIONS": {
"sslmode": "require",
"options": "-c search_path=app,public"
}
}
}
You shared the connection configuration for a python app, but still nothing Docker related. Let me emphesize it again:
I still see nothing that would indicate any Docker issue. You have a postgres error message. We don’t know your database, we don’t know what it should container what it shouldn’t, how you start the database, using what Docker image, with what parameters. so we don’t know what is possible in your case and what isn’t.
We know only what you share, and the details you shared so far could be totally not related to Docker.
post can be closed
solution has been provided elsewhere
Was it a Docker issue? Would you like to share the solution so other users can learn from it?