migrate icon indicating copy to clipboard operation
migrate copied to clipboard

Migration rolled back

Open wjch-krl opened this issue 2 years ago • 0 comments

Describe the Bug When search_path doesn't contain public upon completion of migrations script, migrations fails - but the changes are not rolled back (output below)

Steps to Reproduce Steps to reproduce the behaviour:

  1. Create up script, that would modify the search path - e.g.:
create schema foo;
set search_path to foo;
CREATE TABLE bar(
    baz INTEGER NOT NULL,
    primary key(baz)
);
  1. run migrate up to include ^^
  2. See error

Expected Behavior Migration should be rolled back when any error occurs

Migrate Version v4.15.1 Obtained by running: migrate -version

Loaded Source Drivers file

Loaded Database Drivers postgres

Go Version go version go1.17.6 darwin/arm64

Stacktrace N/A

Additional context

./script/migrate
2022/03/28 09:46:43 Start buffering 5/u test
2022/03/28 09:46:43 Read and execute 5/u test
2022/03/28 09:46:43 error: pq: relation "schema_migrations" does not exist in line 0: TRUNCATE "schema_migrations"
ERROR: 1

wjch-krl avatar Mar 28 '22 10:03 wjch-krl