Skip to content

Commit

Permalink
Do case-insensitive schema comparisons to test for schema existance
Browse files Browse the repository at this point in the history
  • Loading branch information
edmundyan committed Aug 5, 2019
1 parent b2f2e69 commit f03f9cc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion core/dbt/task/runnable.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,12 @@ def create_schemas(self, adapter, selected_uids):
for db in required_databases:
existing_schemas.update((db, s) for s in adapter.list_schemas(db))

for database, schema in (required_schemas - existing_schemas):
lower_tuple = lambda t: tuple(map(str.lower, t))

required_schemas_lowered = set(map(lower_tuple, required_schemas))
existing_schemas_lowered = set(map(lower_tuple, existing_schemas))

for database, schema in (required_schemas_lowered - existing_schemas_lowered):
adapter.create_schema(database, schema)

def get_result(self, results, elapsed_time, generated_at):
Expand Down

0 comments on commit f03f9cc

Please sign in to comment.