From 828f32ee8182a84d1ef1b8b05bcd84662f7388a6 Mon Sep 17 00:00:00 2001 From: k4rli Date: Mon, 25 Aug 2025 11:51:43 +0300 Subject: [PATCH] feat(MED-85): create audit log on orders view + export csv --- .../20250825094541_medipost_dispatch_audit.sql | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 supabase/migrations/20250825094541_medipost_dispatch_audit.sql diff --git a/supabase/migrations/20250825094541_medipost_dispatch_audit.sql b/supabase/migrations/20250825094541_medipost_dispatch_audit.sql new file mode 100644 index 0000000..97e65fd --- /dev/null +++ b/supabase/migrations/20250825094541_medipost_dispatch_audit.sql @@ -0,0 +1,12 @@ +CREATE TABLE "audit"."medipost_dispatch" ( + "id" bigint generated by default as identity not null, + "medusa_order_id" text not null, + "is_medipost_error" boolean not null, + "is_success" boolean not null, + "error_message" text, + "created_at" timestamp with time zone not null default now(), + "changed_by" uuid not null +); + +grant usage on schema audit to service_role; +grant select, insert, update, delete on table audit.medipost_dispatch to service_role;