diff --git a/internal/db/migrations/postgres/02_oplog.up.sql b/internal/db/migrations/postgres/02_oplog.up.sql index c2634e697..7a7a79649 100644 --- a/internal/db/migrations/postgres/02_oplog.up.sql +++ b/internal/db/migrations/postgres/02_oplog.up.sql @@ -1,3 +1,5 @@ +begin; + CREATE TABLE if not exists oplog_entry ( id bigint generated always as identity primary key, create_time wt_timestamp, @@ -37,3 +39,5 @@ values ('db_test_user', 1), ('db_test_car', 1), ('db_test_rental', 1); + +commit; diff --git a/internal/db/migrations/postgres/03_db.down.sql b/internal/db/migrations/postgres/03_db.down.sql index 92a48e33d..d4c3b5217 100644 --- a/internal/db/migrations/postgres/03_db.down.sql +++ b/internal/db/migrations/postgres/03_db.down.sql @@ -1,3 +1,7 @@ +begin; + drop table if exists db_test_user; drop table if exists db_test_car; -drop table if exists db_test_rental; \ No newline at end of file +drop table if exists db_test_rental; + +commit; diff --git a/internal/db/migrations/postgres/03_db.up.sql b/internal/db/migrations/postgres/03_db.up.sql index e984e22f2..07ba34cf0 100644 --- a/internal/db/migrations/postgres/03_db.up.sql +++ b/internal/db/migrations/postgres/03_db.up.sql @@ -1,3 +1,5 @@ +begin; + -- create test tables used in the unit tests for the internal/db package -- these tables (db_test_user, db_test_car, db_test_rental) are not part -- of the Watchtower domain model... they are simply used for testing the internal/db package @@ -28,3 +30,5 @@ CREATE TABLE if not exists db_test_rental ( user_id bigint not null REFERENCES db_test_user(id), car_id bigint not null REFERENCES db_test_car(id) ); + +commit;