From cd2845edd5e164f38de7fe83ebc54c853f2d1a4d Mon Sep 17 00:00:00 2001 From: Kai Mueller Date: Mon, 30 Oct 2023 09:06:47 +0000 Subject: [PATCH] Fix --- test/ci_setup.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/ci_setup.py b/test/ci_setup.py index ea9391a..27fe6af 100644 --- a/test/ci_setup.py +++ b/test/ci_setup.py @@ -28,6 +28,12 @@ def setup(dburi: str) -> str: cursor.execute( f'CREATE USER {user} PASSWORD "{password}" NO FORCE_FIRST_PASSWORD_CHANGE' ) + for schema in ["TEST_SCHEMA", "TEST_SCHEMA2"]: + cursor.execute(f"SELECT 1 FROM SCHEMAS WHERE SCHEMA_NAME='{schema}'") + if cursor.fetchall(): + cursor.execute(f"DROP SCHEMA {schema} CASCADE") + cursor.execute(f"CREATE SCHEMA {schema}") + cursor.execute(f"GRANT ALL PRIVILEGES ON SCHEMA {schema} TO {user}") cursor.execute(f"GRANT CREATE SCHEMA TO {user}") return f"hana://{user}:{password}@{url.hostname}:{url.port}"