-- Migration: Add birth_registration JSONB field to videos table -- Purpose: Store original registration information (MAC, User, Time, Path) -- Date: 2026-04-27 -- Add birth_registration JSONB field ALTER TABLE videos ADD COLUMN birth_registration JSONB; -- Add comment COMMENT ON COLUMN videos.birth_registration IS 'Birth registration information: original MAC address, username, timestamp, path'; -- Example birth_registration structure: -- { -- "registration_source": { -- "mac_address": "a1:b2:c3:d4:e5:f6", -- "username": "demo", -- "timestamp": "2026-04-27T22:00:00+08:00", -- "original_path": "./demo", -- "original_filename": "GOPR0001.mp4" -- }, -- "permission_control": { -- "mac_binding": { -- "license_key": "demo_license", -- "is_active": true -- }, -- "user_privacy": { -- "privacy_level": "private", -- "data_isolation": true -- } -- } -- } -- Create GIN index for JSONB queries CREATE INDEX IF NOT EXISTS idx_videos_birth_registration ON videos USING gin (birth_registration);