fix(bug): database migration does not rollback schema version on hook failure (#5908)

* add tests

* correct expect schema version

* use conventional named return

* add rollback test and more description in godoc

* refactor to use commit at the end and defer rollback

* add comment

* lint
This commit is contained in:
Sorawis Nilparuk (Bo) authored and GitHub committed 2025-07-09 10:11:30 -04:00
1 parent 8b8fb28228
commit d32245a33e
5 files changed
+67 -38

No files matched your search

@@ -0,0 +1,8 @@
-- Copyright (c) HashiCorp, Inc.
-- SPDX-License-Identifier: BUSL-1.1
begin;
create table test_five (
id tt_public_id primary key
);
commit;