A1→A2 now looks up the opentext_id in master_assets for an M-prefixed record from B1→B2 and stores it as global_master_tracking_id on the local asset record. This provides traceability from local campaign assets back to their global master without changing any existing workflow logic or DAM metadata. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
13 lines
556 B
SQL
13 lines
556 B
SQL
-- Migration 004: Add global_master_tracking_id column to master_assets
|
|
-- Purpose: Links local campaign assets (A1→A2) back to their global master (B1→B2)
|
|
-- by storing the M-prefixed tracking ID from the B1 record
|
|
-- Date: 2026-03-21
|
|
|
|
ALTER TABLE master_assets
|
|
ADD COLUMN IF NOT EXISTS global_master_tracking_id VARCHAR(6);
|
|
|
|
-- Index for lookups
|
|
CREATE INDEX IF NOT EXISTS idx_master_assets_global_master_tracking
|
|
ON master_assets(global_master_tracking_id);
|
|
|
|
\echo 'Migration 004 complete: Added global_master_tracking_id to master_assets'
|