DO $$
BEGIN
  IF NOT EXISTS (
    SELECT 1
    FROM information_schema.tables
    WHERE table_schema = 'public' AND table_name = 'oauth_clients'
  ) THEN
    RAISE EXCEPTION 'missing oauth_clients table';
  END IF;

  IF NOT EXISTS (SELECT 1 FROM permissions WHERE code = 'iam:client:write') THEN
    RAISE EXCEPTION 'missing iam client permissions seed';
  END IF;
END $$;

