company_notes was missing updated_at — every other notes table has it, and notes.service.ts substituted created_at into the response shape so callers wouldn't notice. Add the column (defaulted + backfilled to created_at for existing rows), wire the update path to set it on edit, and drop the substitution from the read + edit handlers. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
8 lines
390 B
SQL
8 lines
390 B
SQL
-- Add updated_at to company_notes so the notes service can return a real
|
|
-- modified timestamp (was substituting created_at). Backfill updated_at
|
|
-- to created_at for existing rows so they read as "never modified".
|
|
ALTER TABLE "company_notes"
|
|
ADD COLUMN IF NOT EXISTS "updated_at" timestamp with time zone NOT NULL DEFAULT now();
|
|
|
|
UPDATE "company_notes" SET "updated_at" = "created_at";
|