Run migrations in a transaction (#60)

This commit is contained in:
Michael Gaffney authored and GitHub committed 2020-05-16 13:26:57 -04:00
1 parent f8b456f3a7
commit 3d614dd732
3 files changed
+13 -1

No files matched your search

@@ -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;
@@ -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;
drop table if exists db_test_rental;
commit;
@@ -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;