Skip to content

Commit

Permalink
Merge pull request #58 from stewartbryson/develop
Browse files Browse the repository at this point in the history
Ephemeral now uses CREATE DATABASE... IF NOT EXISTS.
  • Loading branch information
stewartbryson authored Dec 2, 2022
2 parents 1be66f2 + 74f08cb commit f4d0309
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ abstract class SnowflakeEphemeralTask extends SnowflakeTask {
*/
def createClone() {
if (useEphemeral) {
session.jdbcConnection().createStatement().execute("create or replace database ${ephemeralName} clone $database")
session.jdbcConnection().createStatement().execute("create database if not exists ${ephemeralName} clone $database")
session.jdbcConnection().createStatement().execute("grant ownership on database ${ephemeralName} to $role")
session.jdbcConnection().createStatement().execute("use schema ${ephemeralName}.${schema}")
log.warn "Ephemeral clone $ephemeralName created."
Expand Down

0 comments on commit f4d0309

Please sign in to comment.