diff --git a/internal/db/migrations/postgres.gen.go b/internal/db/migrations/postgres.gen.go index 9702d223dc..801e7c4c31 100644 --- a/internal/db/migrations/postgres.gen.go +++ b/internal/db/migrations/postgres.gen.go @@ -12,8 +12,11 @@ begin; drop domain wt_timestamp; drop domain wt_public_id; -drop function update_time_column() cascade; -drop function immutable_create_time_func() cascade; + +drop function default_create_time; +drop function immutable_create_time_func; +drop function update_time_column; + commit; `), @@ -101,22 +104,12 @@ commit; bytes: []byte(` begin; -drop table if exists oplog_entry cascade; - -drop trigger if exists update_oplog_entry_update_time on oplog_entry; -drop trigger if exists update_oplog_entry_create_time on oplog_entry; - -drop table if exists oplog_ticket cascade; - -drop trigger if exists update_oplog_ticket_update_time on oplog_ticket; -drop trigger if exists update_oplog_ticket_create_time on oplog_ticket; - -drop table if exists oplog_metadata cascade; - -drop trigger if exists update_oplog_metadata_update_time on oplog_metadata; -drop trigger if exists update_oplog_metadata_create_time on oplog_metadata; +drop table oplog_metadata cascade; +drop table oplog_ticket cascade; +drop table oplog_entry cascade; commit; + `), }, "migrations/02_oplog.up.sql": { @@ -234,18 +227,9 @@ commit; bytes: []byte(` begin; -drop table if exists db_test_user; -drop table if exists db_test_car; -drop table if exists db_test_rental; - -drop trigger if exists update_db_test_user_update_time on db_test_user; -drop trigger if exists update_db_test_user_create_time on db_test_user; - -drop trigger if exists update_db_test_car_update_time on db_test_car; -drop trigger if exists update_db_test_car_create_time on db_test_car; - -drop trigger if exists update_db_test_rental_update_time on db_test_rental; -drop trigger if exists update_db_test_rental_create_time on db_test_rental; +drop table db_test_rental; +drop table db_test_car; +drop table db_test_user; commit; @@ -353,15 +337,19 @@ commit; bytes: []byte(` BEGIN; -drop table if exists iam_scope CASCADE; -drop table if exists iam_user cascade; -drop table if exists iam_group cascade; +drop table iam_group cascade; +drop table iam_user cascade; +drop table iam_scope_project cascade; +drop table iam_scope_organization cascade; +drop table iam_scope cascade; +drop table iam_scope_type_enm cascade; -drop function iam_sub_scopes_func cascade; -drop function iam_immutable_scope_type_func cascade; drop function iam_sub_names cascade; +drop function iam_immutable_scope_type_func cascade; +drop function iam_sub_scopes_func cascade; COMMIT; + `), }, "migrations/04_iam.up.sql": { diff --git a/internal/db/migrations/postgres/01_domain_types.down.sql b/internal/db/migrations/postgres/01_domain_types.down.sql index 987ef1c3bc..cc3bd506f9 100644 --- a/internal/db/migrations/postgres/01_domain_types.down.sql +++ b/internal/db/migrations/postgres/01_domain_types.down.sql @@ -2,6 +2,9 @@ begin; drop domain wt_timestamp; drop domain wt_public_id; -drop function update_time_column() cascade; -drop function immutable_create_time_func() cascade; + +drop function default_create_time; +drop function immutable_create_time_func; +drop function update_time_column; + commit; diff --git a/internal/db/migrations/postgres/02_oplog.down.sql b/internal/db/migrations/postgres/02_oplog.down.sql index 649b222682..f855477a0f 100644 --- a/internal/db/migrations/postgres/02_oplog.down.sql +++ b/internal/db/migrations/postgres/02_oplog.down.sql @@ -1,18 +1,7 @@ begin; -drop table if exists oplog_entry cascade; +drop table oplog_metadata cascade; +drop table oplog_ticket cascade; +drop table oplog_entry cascade; -drop trigger if exists update_oplog_entry_update_time on oplog_entry; -drop trigger if exists update_oplog_entry_create_time on oplog_entry; - -drop table if exists oplog_ticket cascade; - -drop trigger if exists update_oplog_ticket_update_time on oplog_ticket; -drop trigger if exists update_oplog_ticket_create_time on oplog_ticket; - -drop table if exists oplog_metadata cascade; - -drop trigger if exists update_oplog_metadata_update_time on oplog_metadata; -drop trigger if exists update_oplog_metadata_create_time on oplog_metadata; - -commit; \ No newline at end of file +commit; diff --git a/internal/db/migrations/postgres/03_db.down.sql b/internal/db/migrations/postgres/03_db.down.sql index c8b98a43be..7eab5ab886 100644 --- a/internal/db/migrations/postgres/03_db.down.sql +++ b/internal/db/migrations/postgres/03_db.down.sql @@ -1,16 +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 trigger if exists update_db_test_user_update_time on db_test_user; -drop trigger if exists update_db_test_user_create_time on db_test_user; - -drop trigger if exists update_db_test_car_update_time on db_test_car; -drop trigger if exists update_db_test_car_create_time on db_test_car; - -drop trigger if exists update_db_test_rental_update_time on db_test_rental; -drop trigger if exists update_db_test_rental_create_time on db_test_rental; +drop table db_test_rental; +drop table db_test_car; +drop table db_test_user; commit; diff --git a/internal/db/migrations/postgres/04_iam.down.sql b/internal/db/migrations/postgres/04_iam.down.sql index fe28c36c0d..2857269db1 100644 --- a/internal/db/migrations/postgres/04_iam.down.sql +++ b/internal/db/migrations/postgres/04_iam.down.sql @@ -1,11 +1,14 @@ BEGIN; -drop table if exists iam_scope CASCADE; -drop table if exists iam_user cascade; -drop table if exists iam_group cascade; +drop table iam_group cascade; +drop table iam_user cascade; +drop table iam_scope_project cascade; +drop table iam_scope_organization cascade; +drop table iam_scope cascade; +drop table iam_scope_type_enm cascade; -drop function iam_sub_scopes_func cascade; -drop function iam_immutable_scope_type_func cascade; drop function iam_sub_names cascade; +drop function iam_immutable_scope_type_func cascade; +drop function iam_sub_scopes_func cascade; -COMMIT; \ No newline at end of file +COMMIT;