-- 补充 SIGNED_FILE_URL 字段（在线签章原始下载地址）
-- 幂等执行：如已存在则跳过
DECLARE
    v_count NUMBER;
BEGIN
    SELECT COUNT(*) INTO v_count FROM ALL_TAB_COLUMNS
    WHERE OWNER = 'DEVELOPER' AND TABLE_NAME = 'SEAL_CONTRACT_LAUNCH_MAIN' AND COLUMN_NAME = 'SIGNED_FILE_URL';
    IF v_count = 0 THEN
        EXECUTE IMMEDIATE 'ALTER TABLE SEAL_CONTRACT_LAUNCH_MAIN ADD SIGNED_FILE_URL VARCHAR2(500)';
        EXECUTE IMMEDIATE 'COMMENT ON COLUMN SEAL_CONTRACT_LAUNCH_MAIN.SIGNED_FILE_URL IS ''在线签章平台原始下载地址''';
        DBMS_OUTPUT.PUT_LINE('SIGNED_FILE_URL column added.');
    ELSE
        DBMS_OUTPUT.PUT_LINE('SIGNED_FILE_URL already exists, skipped.');
    END IF;
END;
/
