<?xml version="1.0" encoding="UTF-8"?>
<!-- This XML cypher DBPR sets the service tier for a list of vendorIds,
Possible ServiceTier values are diy-tier-1 (basic), tier-1, tier-2, tier-3, premium-services -->
<changelog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="./schema.xsd">
    <!-- deletes existing ServiceTiers from existing vendors -->
    <changeset id="INT-2133-AltaFonte-set-326-vendors-to-service-tier-level-Tier-3:1" author="wcheong" run-always="true">
        <cypherquery>
            <![CDATA[
                MATCH (v:Vendor)-[rel:IN_SERVICE_TIER]->(s:ServiceTier)
                WHERE v.vendorId IN [
                781872, 781874, 781881, 781885, 781892, 781896, 781898, 781919, 781925, 781929, 781931, 781940, 782777, 782780, 782786, 782820, 782974, 783015, 783021, 783039, 783052, 783093, 783110, 783132, 783134, 783159, 783173, 783330, 783360, 783430, 783558, 783598, 783613, 783753, 783799, 783810, 783817, 783847, 783855, 783860, 783892, 783932, 783975, 784010, 784041, 784048, 784079, 784118, 784147, 784156, 784198, 784225, 784280, 784338, 784359, 784383, 784399, 784489, 784647, 784695, 784755, 784771, 784826, 784855, 784865, 784933, 784981, 784992, 785010, 785015, 785081, 785136, 785140, 785195, 785228, 785258, 785265, 785274, 785364, 785412, 785452, 785495, 785527, 785547, 785571, 785628, 785679, 785680, 785703, 785711, 785733, 785812, 785885, 786023, 786082, 786090, 786160, 786187, 786280, 786291, 786320, 786380, 786399, 786434, 786439, 786446, 786472, 786533, 786544, 786599, 786625, 786688, 786707, 786733, 786734, 786761, 786795, 786799, 786861, 786967, 786982, 787004, 787054, 787147, 787186, 787197, 787226, 787320, 787341, 787353, 787383, 787418, 787422, 787500, 787527, 787585, 787596, 787649, 787704, 787710, 787725, 787729, 787764, 787767, 787775, 787825, 787827, 787831, 787837, 787859, 787893, 787917, 787920, 787934, 787972, 787988, 788026, 788049, 788116, 788147, 788180, 788198, 788203, 788219, 788223, 788239, 788286, 788294, 788306, 788331, 788332, 788339, 788360, 788369, 788379, 788382, 788413, 788420, 788441, 788451, 788473, 788481, 788489, 788491, 788494, 788510, 788522, 788576, 788577, 788582, 788586, 788592, 788608, 788670, 788682, 788683, 788685, 788687, 788696, 788703, 788707, 788712, 788717, 788720, 788725, 788728, 788748, 788749, 788760, 788763, 788769, 788784, 788789, 788800, 788805, 788813, 788821, 788830, 788833, 788846, 788849, 788851, 788868, 788873, 788905, 788913, 788920, 788949, 788965, 788978, 788987, 789002, 789011, 789015, 789018, 789019, 789022, 789044, 789075, 789079, 789086, 789103, 789105, 789107, 789119, 789150, 789181, 789187, 789189, 789194, 789257, 789280, 789284, 789300, 789338, 789357, 789363, 789374, 789380, 789394, 789396, 789399, 789400, 789401, 789404, 789419, 789442, 789453, 789472, 789482, 789497, 789507, 789521, 789525, 789532, 789534, 789542, 789551, 789558, 789563, 789577, 789589, 789596, 789652, 789665, 789674, 789675, 789684, 789700, 789709, 789723, 789732, 789734, 789738, 789745, 789759, 789778, 789779, 789785, 789819, 789838, 789848, 789855, 789866, 789880, 789890, 789897, 789900, 789903, 789929, 789934, 789935, 789944, 789970, 789994, 790000, 790007, 790030, 790032, 790045, 790054, 790099, 790145, 790151, 791700, 791706
                ]
                DELETE rel
                RETURN v,s
            ]]>
        </cypherquery>
    </changeset>
    <!-- sets the new serviceTiers for existing vendors -->
    <changeset id="INT-2133-AltaFonte-set-326-vendors-to-service-tier-level-Tier-3:2" author="wcheong" run-always="true">
        <cypherquery>
            <![CDATA[
                MATCH (v:Vendor), (s:ServiceTier)
                WHERE v.vendorId IN [
                781872, 781874, 781881, 781885, 781892, 781896, 781898, 781919, 781925, 781929, 781931, 781940, 782777, 782780, 782786, 782820, 782974, 783015, 783021, 783039, 783052, 783093, 783110, 783132, 783134, 783159, 783173, 783330, 783360, 783430, 783558, 783598, 783613, 783753, 783799, 783810, 783817, 783847, 783855, 783860, 783892, 783932, 783975, 784010, 784041, 784048, 784079, 784118, 784147, 784156, 784198, 784225, 784280, 784338, 784359, 784383, 784399, 784489, 784647, 784695, 784755, 784771, 784826, 784855, 784865, 784933, 784981, 784992, 785010, 785015, 785081, 785136, 785140, 785195, 785228, 785258, 785265, 785274, 785364, 785412, 785452, 785495, 785527, 785547, 785571, 785628, 785679, 785680, 785703, 785711, 785733, 785812, 785885, 786023, 786082, 786090, 786160, 786187, 786280, 786291, 786320, 786380, 786399, 786434, 786439, 786446, 786472, 786533, 786544, 786599, 786625, 786688, 786707, 786733, 786734, 786761, 786795, 786799, 786861, 786967, 786982, 787004, 787054, 787147, 787186, 787197, 787226, 787320, 787341, 787353, 787383, 787418, 787422, 787500, 787527, 787585, 787596, 787649, 787704, 787710, 787725, 787729, 787764, 787767, 787775, 787825, 787827, 787831, 787837, 787859, 787893, 787917, 787920, 787934, 787972, 787988, 788026, 788049, 788116, 788147, 788180, 788198, 788203, 788219, 788223, 788239, 788286, 788294, 788306, 788331, 788332, 788339, 788360, 788369, 788379, 788382, 788413, 788420, 788441, 788451, 788473, 788481, 788489, 788491, 788494, 788510, 788522, 788576, 788577, 788582, 788586, 788592, 788608, 788670, 788682, 788683, 788685, 788687, 788696, 788703, 788707, 788712, 788717, 788720, 788725, 788728, 788748, 788749, 788760, 788763, 788769, 788784, 788789, 788800, 788805, 788813, 788821, 788830, 788833, 788846, 788849, 788851, 788868, 788873, 788905, 788913, 788920, 788949, 788965, 788978, 788987, 789002, 789011, 789015, 789018, 789019, 789022, 789044, 789075, 789079, 789086, 789103, 789105, 789107, 789119, 789150, 789181, 789187, 789189, 789194, 789257, 789280, 789284, 789300, 789338, 789357, 789363, 789374, 789380, 789394, 789396, 789399, 789400, 789401, 789404, 789419, 789442, 789453, 789472, 789482, 789497, 789507, 789521, 789525, 789532, 789534, 789542, 789551, 789558, 789563, 789577, 789589, 789596, 789652, 789665, 789674, 789675, 789684, 789700, 789709, 789723, 789732, 789734, 789738, 789745, 789759, 789778, 789779, 789785, 789819, 789838, 789848, 789855, 789866, 789880, 789890, 789897, 789900, 789903, 789929, 789934, 789935, 789944, 789970, 789994, 790000, 790007, 790030, 790032, 790045, 790054, 790099, 790145, 790151, 791700, 791706
                ]
                AND s.name = 'tier-3'
                MERGE (v)-[rel:IN_SERVICE_TIER]->(s)
                    ON CREATE SET rel.createdAt = datetime(), rel.createdBy = 'INT-2133',
                                  rel.updatedAt = datetime(), rel.updatedBy = 'INT-2133'
                RETURN v,s
            ]]>
        </cypherquery>
    </changeset>
</changelog>