Skip to content

Commit

Permalink
fix: add fixed order when selecting types to drop (fixes issue #2207) (
Browse files Browse the repository at this point in the history
…#2208)

* fix: add fixed order when selecting types to drop

* Update internal/db/reset/templates/drop.sql

* chore: reformat drop sql

---------

Co-authored-by: Han Qiao <sweatybridge@gmail.com>
  • Loading branch information
hammerlscs and sweatybridge committed Apr 25, 2024
1 parent cad5d54 commit 1c01e8e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/db/reset/templates/drop.sql
Expand Up @@ -59,7 +59,9 @@ begin
for rec in
select *
from pg_type t
where t.typnamespace::regnamespace::name = 'public'
where
t.typnamespace::regnamespace::name = 'public'
and typtype != 'b'
loop
execute format('drop type if exists %I.%I cascade', rec.typnamespace::regnamespace::name, rec.typname);
end loop;
Expand Down

0 comments on commit 1c01e8e

Please sign in to comment.