Ledger Nano X - The secure hardware wallet
SHARE
TWEET

Untitled

a guest Apr 3rd, 2020 134 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. CREATE TEMP TABLE captureHostLocations (
  3.     "captureHostId" uuid,
  4.     "name" text,
  5.     "clientId" uuid,
  6.     "locationId" uuid
  7. );
  8.  
  9. INSERT INTO captureHostLocations (
  10.     "captureHostId",
  11.     "name",
  12.     "clientId",
  13.     "locationId"
  14. )
  15. SELECT
  16.     ch."captureHostId",
  17.     ch."captureHostName",
  18.     ch."clientId",
  19.     uuid_generate_v4()
  20. FROM "CaptureHosts" as ch
  21. WHERE ch."locationId" IS NULL;
  22.  
  23. INSERT INTO "Locations" (
  24.     "locationId",
  25.     "clientId",
  26.     "parentLocationId",
  27.     "locationName",
  28.     "locationSort",
  29.     "locationActive"
  30. )
  31. SELECT
  32.     "locationId",
  33.     "clientId",
  34.     NULL,
  35.     "name",
  36.   ROW_NUMBER() OVER(ORDER BY "locationId") + (
  37.       SELECT MAX("locationSort")
  38.       FROM "Locations"
  39.     ) as "locationSort",
  40.     TRUE
  41. FROM captureHostLocations;
  42.  
  43. UPDATE "CaptureHosts" as ch
  44. SET "locationId" = captureHostLocations."locationId"
  45. FROM captureHostLocations
  46. WHERE ch."captureHostId" = captureHostLocations."captureHostId";
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top