begin transaction;
CREATE SCHEMA if not exists DEMO;
use schema demo;
CREATE TABLE HELLO_WORLD
(
FIRST_NAME VARCHAR
,LAST_NAME VARCHAR
);
select 1/0;
commit;
Expected behavior
When running this migration I would expect that once the last command select 1/0 is reached, the entire migration is rolled back. Running a second time would give the same error as the first:
snowflake.connector.errors.ProgrammingError: 100051 (22012): Division by zero
Actual behavior
The table is created and persists. If I run the second time, the error is now that the table already exists:
I know this is a contrived example, but I discovered this when testing out the tool. I had a mistake in a migration file and it left the migration in a partial state, even though autocommit is set to false.
Here is my
schemachange-config.yml
file:here is my migration file:
Expected behavior
When running this migration I would expect that once the last command
select 1/0
is reached, the entire migration is rolled back. Running a second time would give the same error as the first:Actual behavior
The table is created and persists. If I run the second time, the error is now that the table already exists:
I know this is a contrived example, but I discovered this when testing out the tool. I had a mistake in a migration file and it left the migration in a partial state, even though autocommit is set to false.