docker compose django api non default database schema

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?

Exactly how to do this will depend on the database engine you’re using.

In postgres, this can be done with the search_path option, which can be set in DATABASES["default"]["OPTIONS"]["options"].

i have this in my settings

“OPTIONS”: {
“sslmode”: “require”,
“options”: “-c search_path=app,public”

app is the name of my schema
and that is what isn’t being created when running my test
docker compose run --rm app python manage.py test --noinput

Django won’t create the additional schema for you, all you’re doing is telling postgres that that’s one you want to look for. If you need another one, you’ll need to create it yourself.

yeah i had created it, but my tests weren’t working.
i started again and i deleted the table and then set my search path only to be app, public
all my tables were created in the app schema and my tests worked

so i wanted to do a 2nd test and that was setting the models to have explicit schema and still using the search path
tables got created and then tests fail
LINE 1: CREATE TABLE “app”.“defect” (“id” bigint NOT NULL PRIMARY KE…