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