<?xml version="1.0" encoding="UTF-8"?>
<changelog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="file:/var/app/InputFileSchema.xsd">
  <changeset
   id="DS-4960-migrate-users-to-4x-cluster:1"
   author="ibolshakov"
   run-always="true"
   neo4j-server-uri='bolt+ssc://10.100.47.192:7687'>
        <cypherquery>
          <![CDATA[
LOAD CSV FROM 'file:///auth.ini' as line FIELDTERMINATOR ':'
WITH line[0] as username, split(line[1], ",")[1] +","+ split(line[1], ",")[2] as hash, line[2] as pwdChange
WITH username, hash, CASE pwdChange IS NULL WHEN true THEN "NOT" ELSE "" END as pwdChange
WITH "CREATE OR REPLACE USER `"+username+"` SET ENCRYPTED PASSWORD '0,"+hash+"' CHANGE "+pwdChange+" REQUIRED;" as cypher
CALL apoc.systemdb.execute(cypher, {}) yield row return row;
          ]]>
        </cypherquery>
    </changeset>
</changelog>
