I currently have a .sql
file with the likes of:
DROP VIEW IF EXISTS vw_example;
CREATE VIEW vw_example as
SELECT a FROM b;
When running this command as part of a flyway migration, if the view already exists, it fails, as if the create command is not waiting for the DROP IF EXISTS
to finish.
I know SQL server has a GO
type keyword. Is there a way to sort of tell cockroachdb to wait for the first command?
cockroach sql
shell (ordemo
if you're on 19.2+):\| echo "DROP VIEW IF EXISTS vw_example; CREATE VIEW vw_example as SELECT count(1) from pg_settings;"
. Are you sure slick is executing those statements in the stated order/from a file? – Peter Vandivier