-- Larva export → PostgreSQL
-- Generated 2026-07-12T11:19:53.950Z by @larva-db/core (Design §12, the escape hatch)
-- Load with:  psql $DATABASE_URL < export.sql

BEGIN;

CREATE TABLE "customers" (
  "id" text PRIMARY KEY,
  "name" text,
  "email" text UNIQUE,
  "city" text,
  "createdAt" timestamptz
);
CREATE TABLE "orders" (
  "id" text PRIMARY KEY,
  "customerId" text,
  "total" double precision,
  "status" text,
  "createdAt" timestamptz
);
CREATE TABLE "invoices" (
  "number" bigint PRIMARY KEY,
  "customer" text,
  "total" double precision
);

COPY "customers" ("id", "name", "email", "city", "createdAt") FROM stdin;
01KXAN1P072MCWZTDJ91QA7FBX	Edsger Dijkstra	edsger@example.com	Austin	2026-06-14T08:20:00Z
01KXAN1P075YNMXXFQTEG31DVC	Barbara Liskov	barbara@example.com	Boston	2026-06-25T11:00:00Z
01KXAN1P0763V2HVMDZKJWAEXH	Alan Turing	alan@example.com	London	2026-05-20T10:15:00Z
01KXAN1P07RZ329PJV289GJE18	Ada Lovelace	ada@example.com	London	2026-05-03T09:00:00Z
01KXAN1P07VGZGF2BNWESMQNJ5	Katherine Johnson	katherine@example.com	Hampton	2026-06-02T16:45:00Z
01KXAN1P07ZNNQGEE29EXTSFTN	Grace Hopper	grace@example.com	New York	2026-05-11T14:30:00Z
\.
COPY "orders" ("id", "customerId", "total", "status", "createdAt") FROM stdin;
01KXAN1P533BBVMSGE7XN8EXQK	01KXAN1P07VGZGF2BNWESMQNJ5	431	paid	2026-05-11T12:00:00Z
01KXAN1P53C9MXD7H98JQHVXBS	01KXAN1P075YNMXXFQTEG31DVC	225	paid	2026-05-17T12:00:00Z
01KXAN1P53E2DDAZX860ZWMBTQ	01KXAN1P07RZ329PJV289GJE18	362	paid	2026-05-20T12:00:00Z
01KXAN1P53GPQX7P5VT2XT54ZZ	01KXAN1P07ZNNQGEE29EXTSFTN	499	pending	2026-05-23T12:00:00Z
01KXAN1P53PMBTKA1TRTDC4KS1	01KXAN1P07RZ329PJV289GJE18	20	paid	2026-05-02T12:00:00Z
01KXAN1P53Q32FZ39VXB401W8B	01KXAN1P072MCWZTDJ91QA7FBX	88	refunded	2026-05-14T12:00:00Z
01KXAN1P53RPVG72YJDK4F1VCY	01KXAN1P07ZNNQGEE29EXTSFTN	157	paid	2026-05-05T12:00:00Z
01KXAN1P53VMZE26YTXRB9N82M	01KXAN1P0763V2HVMDZKJWAEXH	294	pending	2026-05-08T12:00:00Z
01KXAN1P92511WWCZFFNP1NC91	01KXAN1P07RZ329PJV289GJE18	87	refunded	2026-06-11T12:00:00Z
01KXAN1P926ECWD4GJTNDMAJMN	01KXAN1P0763V2HVMDZKJWAEXH	361	paid	2026-06-17T12:00:00Z
01KXAN1P927CT5NMAY7FDQNDJY	01KXAN1P07VGZGF2BNWESMQNJ5	156	paid	2026-06-02T12:00:00Z
01KXAN1P92FNWHGFJHQSSGZ8RF	01KXAN1P072MCWZTDJ91QA7FBX	293	pending	2026-06-05T12:00:00Z
01KXAN1P92MYCXRAKQPTJ61ZG2	01KXAN1P075YNMXXFQTEG31DVC	430	paid	2026-06-08T12:00:00Z
01KXAN1P92N04B47DN4QZBTVVK	01KXAN1P07ZNNQGEE29EXTSFTN	224	paid	2026-06-14T12:00:00Z
01KXAN1P92NTXJDMWCKXQZW81J	01KXAN1P07VGZGF2BNWESMQNJ5	498	pending	2026-06-20T12:00:00Z
01KXAN1P92VXQCDJM4T0CSCBPN	01KXAN1P072MCWZTDJ91QA7FBX	155	paid	2026-06-23T12:00:00Z
\.
COPY "invoices" ("number", "customer", "total") FROM stdin;
\.

-- Foreign keys last, after all data, so load order never matters.
ALTER TABLE "orders" ADD CONSTRAINT "orders_customerId_fkey" FOREIGN KEY ("customerId") REFERENCES "customers" ("id");

COMMIT;
