Files
pn-new-crm/src/lib/db/migrations/0048_company_notes_updated_at.sql

8 lines
390 B
MySQL
Raw Normal View History

-- 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";