DROP FUNCTION IF EXISTS uuidv7;

DROP INDEX IF EXISTS user_username_uniq_idx;
DROP INDEX IF EXISTS user_email_uniq_idx;
DROP INDEX IF EXISTS permission_category_idx;
DROP INDEX IF EXISTS permission_category_name_idx;
DROP INDEX IF EXISTS user_account_permission_user_id_idx;
DROP INDEX IF EXISTS user_account_permission_account_id_idx;
DROP INDEX IF EXISTS transaction_budget_id_idx;
DROP INDEX IF EXISTS user_budget_permission_user_id_idx;
DROP INDEX IF EXISTS user_budget_permission_budget_id_idx;

DROP TABLE IF EXISTS public.user_account_permission;
DROP TABLE IF EXISTS public.user_budget_permission;
DROP TABLE IF EXISTS public.account;
DROP TABLE IF EXISTS public.permission;
DROP TABLE IF EXISTS public.user;
DROP TABLE IF EXISTS public.transaction_line_item;
DROP TABLE IF EXISTS public.transaction CASCADE;
DROP TABLE IF EXISTS public.budget CASCADE;

DROP TYPE IF EXISTS public.entry_type;
DROP TYPE IF EXISTS public.account_type;
DROP TYPE IF EXISTS public.permission_category;
DROP TYPE IF EXISTS public.status;
