Progress
2026-02-20 21:41 - T-001
Scaffolded @packages/db: package.json, tsconfig.json, eslint.config.mjs, drizzle.config.ts, client.ts.
2026-02-20 21:44 - T-002
Defined core_group, core_entity, core_unit tables in schema/core.ts.
2026-02-20 21:46 - T-003
Defined all db_* tables and FK mappings in schema/db.ts.
2026-02-20 21:48 - T-004
Defined all catalog_* tables with composite PK for brand-unit in schema/catalog.ts.
2026-02-20 21:50 - T-005
Defined commerce_order_type, commerce_customer_type, commerce_order, finance_payment_method, finance_payment_status, finance_transaction in schema/commerce.ts and schema/finance.ts.
2026-02-20 21:52 - T-006
Defined all marketing_* tables with composite PK join tables in schema/marketing.ts.
2026-02-20 21:53 - T-007
Defined target_metric and target_item tables with cross-domain FKs in schema/target.ts.
2026-02-20 21:54 - T-008
Exported all schema modules via schema/index.ts; re-exported db and libsql from package entrypoint.
2026-02-20 21:56 - T-009
bun install + bun run test:type --filter @packages/db passing.
2026-02-20 21:59 - T-010
Generated initial Drizzle migration and pushed to atlas-ops.db.
2026-02-20 22:01 - T-011
Added drizzle-kit generate, migrate, and push command examples to AGENTS.md.
2026-02-20 22:03 - T-012 (blocked)
@services/dashboard package was not present yet, so import validation could not be executed.
2026-02-21 00:07 - T-012 completed
Verified @services/dashboard type-check resolves @packages/db via workspace dependency.
2026-02-21 00:07 - Hardening
Added 14 unique indexes across lookup tables, wiped atlas-ops.db, and re-pushed schema with drizzle-kit.
2026-02-21 03:10 - Seed refactor completed
Moved canonical seeding logic to @packages/db/@source/seed.ts using Drizzle ORM, switched root sync:seed to @packages/db, and reduced @packages/sync/@source/seed.ts to a thin re-export wrapper.