From aea597b8711e497915f634ee146ba4afb97aada7 Mon Sep 17 00:00:00 2001 From: Dmitry Sherstobitov Date: Wed, 14 Feb 2024 19:26:27 +0400 Subject: [PATCH] Fixed DB creation code --- yugabyte/src/yugabyte/auto.clj | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/yugabyte/src/yugabyte/auto.clj b/yugabyte/src/yugabyte/auto.clj index ac0cd6993..55c2e7760 100644 --- a/yugabyte/src/yugabyte/auto.clj +++ b/yugabyte/src/yugabyte/auto.clj @@ -532,10 +532,12 @@ db/Primary (setup-primary! [this test node] "Executed once on a first node in list (i.e. n1 by default) after per-node setup is done" - (let [colocated-clause (if (:yb-colocated test) - " WITH colocated = true" - "")] - (ysqlsh test :-h (cn/ip node) :-c (str "CREATE DATABASE jepsen" colocated-clause ";"))) + (if (= (:api test) :ysql) + (let [colocated-clause (if (:yb-colocated test) + " WITH colocated = true" + "")] + (ysqlsh test :-h (cn/ip node) :-c (str "DROP DATABASE IF EXISTS jepsen;")) + (ysqlsh test :-h (cn/ip node) :-c (str "CREATE DATABASE jepsen" colocated-clause ";")))) ) db/LogFiles