From 7a19566e580f4c3c0197bbb4f6195bd4d4a3903c Mon Sep 17 00:00:00 2001 From: Henry Jones Date: Mon, 13 Mar 2023 17:14:23 -0400 Subject: [PATCH] add IF NOT EXISTS to postgresql create table statement --- pyproject.toml | 2 +- relationalize/sql_dialects.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index e091235..9c0c5b3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "relationalize" -version = "0.1.6" +version = "0.1.7" authors = [ { name="Henry Jones", email="henry.jones@tulip.co" }, ] diff --git a/relationalize/sql_dialects.py b/relationalize/sql_dialects.py index 54cf152..91565d5 100644 --- a/relationalize/sql_dialects.py +++ b/relationalize/sql_dialects.py @@ -43,7 +43,7 @@ class PostgresDialect(SQLDialect): } base_ddl: str = """ -CREATE TABLE "{schema}"."{table_name}" ( +CREATE TABLE IF NOT EXISTS "{schema}"."{table_name}" ( {columns} ); """.strip()