Skip to content

Commit

Permalink
Small change to template database initialisation
Browse files Browse the repository at this point in the history
  • Loading branch information
fizyk committed Mar 11, 2024
1 parent 68a3504 commit c069783
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pytest_postgresql/janitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ def init(self) -> None:
"""Create database in postgresql."""
with self.cursor() as cur:
if self.is_template():
cur.execute(f'CREATE DATABASE "{self.template_dbname}";')
cur.execute(f'ALTER DATABASE "{self.template_dbname}" with is_template true;')
cur.execute(f'CREATE DATABASE "{self.template_dbname}" WITH is_template = true;')
elif self.template_dbname is None:
cur.execute(f'CREATE DATABASE "{self.dbname}";')
else:
Expand Down

0 comments on commit c069783

Please sign in to comment.