Skip to content

Commit 6fc5601

Browse files
committed
fix: update target schema default to 'development' in DumpCleaner and config
1 parent 7579d54 commit 6fc5601

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

cloudsql_to_supabase/clean.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def __init__(
1919
) -> None:
2020
self.input_file = Path(input_file or config.OUTPUT_DUMP)
2121
self.output_file = Path(output_file or config.CLEANED_DUMP)
22-
self.target_schema = target_schema or config.SUPABASE_SCHEMA
22+
self.target_schema = target_schema or"development"
2323
self.target_owner = target_owner or "postgres"
2424

2525
logger.info(
@@ -91,6 +91,11 @@ def _build_replacement_rules(self) -> List[Tuple[re.Pattern, str]]:
9191

9292
quoted_target_schema = f'"{self.target_schema}"'
9393

94+
# Add debugging code before the if statement
95+
print(f"Current target_schema: '{self.target_schema}'")
96+
print(f"Type of target_schema: {type(self.target_schema)}")
97+
print(f"Condition result: {self.target_schema != 'public'}")
98+
9499
if self.target_schema != "public":
95100
schema_replacements_raw = [
96101
(r"^\s*SET search_path = public(?:,\s*|\s*;)(.*)$", rf"SET search_path = {quoted_target_schema}, public\1"),
@@ -178,7 +183,7 @@ def clean_dump_file(
178183
cleaner = DumpCleaner(
179184
input_file=input_file,
180185
output_file=output_file,
181-
target_schema=target_schema,
186+
target_schema='development',
182187
target_owner=target_owner
183188
)
184189
return cleaner.clean_dump_file()

cloudsql_to_supabase/config.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@
2727
SUPABASE_PASSWORD = os.getenv("SUPABASE_PASSWORD")
2828
SUPABASE_PORT = int(os.getenv("SUPABASE_PORT", 5432))
2929
SUPABASE_SSL_MODE = os.getenv("SUPABASE_SSL_MODE", "require")
30-
SUPABASE_SCHEMA = os.getenv("SUPABASE_SCHEMA", "public")
30+
31+
"""
32+
Adjust this to match your target schema, in my case I was trying to use development schema in database
33+
"""
34+
SUPABASE_SCHEMA = os.getenv("SUPABASE_SCHEMA", "development")
3135

3236
# Output file paths
3337
OUTPUT_DIR = Path(os.getenv("OUTPUT_DIR", "."))

0 commit comments

Comments
 (0)