awips2/deltaScripts/13.5.1/convertSubscriptionSitesToCollection.sql
Mike Duff c99170b497 Issue #2020 - Implement Shared Subscriptions Cave-side.
Change-Id: I96e156043ec34e7ec98c2d8c3aafb6916c31e7cf

Former-commit-id: e3804d48ec [formerly 80b1f95f0c] [formerly 192ce891d0] [formerly e3804d48ec [formerly 80b1f95f0c] [formerly 192ce891d0] [formerly b6b01c3e81 [formerly 192ce891d0 [formerly 1e00c7f935cf22ac5064060069164af6044f2150]]]]
Former-commit-id: b6b01c3e81
Former-commit-id: e7790088ac [formerly 6ee0ef55ff] [formerly bbd9728434e2386f696b8016882158b60232d706 [formerly a9004667b7]]
Former-commit-id: 1a67b61c05159bc4081f57926a9ff0be90dec414 [formerly 53ca005836]
Former-commit-id: 5b21a6cfa4
2013-05-24 09:20:55 -05:00

36 lines
1.4 KiB
PL/PgSQL

/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
\set ON_ERROR_STOP 1
\connect metadata;
-- Start a transaction
BEGIN;
-- Remove officeID attribute
update ebxml.value set stringvalue = regexp_replace(stringvalue, 'officeID=".*?"', '', 'g');
-- Add officeID element
update ebxml.value set stringvalue = regexp_replace(stringvalue, '(<pendingSiteSubscription.*?>)', E'\\1<officeId>@@SITE@@</officeId>', 'g');
update ebxml.value set stringvalue = regexp_replace(stringvalue, '(<initialPendingSiteSubscription.*?>)', E'\\1<officeId>@@SITE@@</officeId>', 'g');
update ebxml.value set stringvalue = regexp_replace(stringvalue, '(<siteSubscription.*?>)', E'\\1<officeId>@@SITE@@</officeId>', 'g');
-- Commit the transaction
END;