All blocks

Content

Trash

Soft delete through each subject's deletedAt column: trash with children in one batch, restore with unique checks, a list per organization, and purge after a retention period.

DocsModes:managedadoptcustom
terminal
npx better-supabase sql add trash
better-supabase.config.ts
import { defineConfig } from "better-supabase/config";

export default defineConfig({
  sql: {
    modules: {
      // Required by trash; sql add installs them too.
      "updated-at": {},
      tenant: {},
      access: {},
      // Modes: "managed", "adopt", "custom". The default is "managed".
      trash: { mode: "managed" },
    },
  },
});