From 27685695a2a8190aa03c2f8b3e321a22941fa05c Mon Sep 17 00:00:00 2001 From: Jonas Linter <{email_address}> Date: Thu, 4 Dec 2025 17:07:54 +0100 Subject: [PATCH] No schema creation if public --- src/alpine_bits_python/run_migrations.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/alpine_bits_python/run_migrations.py b/src/alpine_bits_python/run_migrations.py index 89cbb03..be941c8 100644 --- a/src/alpine_bits_python/run_migrations.py +++ b/src/alpine_bits_python/run_migrations.py @@ -93,7 +93,9 @@ async def create_all_tables() -> None: async with engine.begin() as conn: # Set search path if schema is configured if schema: - await conn.execute(text(f"CREATE SCHEMA IF NOT EXISTS {schema}")) + # Only create schema if it's not 'public' (public always exists) + if schema != "public": + await conn.execute(text(f"CREATE SCHEMA IF NOT EXISTS {schema}")) await conn.execute(text(f"SET search_path TO {schema}")) # Create all tables