@@ -436,7 +436,12 @@ describe('#integration-rx summary', () => {
436
436
return
437
437
}
438
438
439
- await verifyUpdates ( runnable , 'CREATE INDEX on :Label(prop)' , null , {
439
+ const query =
440
+ protocolVersion > 4.2
441
+ ? 'CREATE INDEX FOR :Label(prop)'
442
+ : 'CREATE INDEX ON :Label(prop)'
443
+
444
+ await verifyUpdates ( runnable , query , null , {
440
445
nodesCreated : 0 ,
441
446
nodesDeleted : 0 ,
442
447
relationshipsCreated : 0 ,
@@ -467,12 +472,20 @@ describe('#integration-rx summary', () => {
467
472
// first create the to-be-dropped index
468
473
const session = driver . session ( )
469
474
try {
470
- await session . run ( 'CREATE INDEX on :Label(prop)' )
475
+ const query =
476
+ protocolVersion > 4.2
477
+ ? 'CREATE INDEX FOR :Label(prop)'
478
+ : 'CREATE INDEX ON :Label(prop)'
479
+ await session . run ( query )
471
480
} finally {
472
481
await session . close ( )
473
482
}
474
483
475
- await verifyUpdates ( runnable , 'DROP INDEX on :Label(prop)' , null , {
484
+ const query =
485
+ protocolVersion > 4.2
486
+ ? 'DROP INDEX FOR :Label(prop)'
487
+ : 'DROP INDEX ON :Label(prop)'
488
+ await verifyUpdates ( runnable , query , null , {
476
489
nodesCreated : 0 ,
477
490
nodesDeleted : 0 ,
478
491
relationshipsCreated : 0 ,
@@ -499,24 +512,23 @@ describe('#integration-rx summary', () => {
499
512
return
500
513
}
501
514
502
- await verifyUpdates (
503
- runnable ,
504
- 'CREATE CONSTRAINT ON (book:Book) ASSERT book.isbn IS UNIQUE' ,
505
- null ,
506
- {
507
- nodesCreated : 0 ,
508
- nodesDeleted : 0 ,
509
- relationshipsCreated : 0 ,
510
- relationshipsDeleted : 0 ,
511
- propertiesSet : 0 ,
512
- labelsAdded : 0 ,
513
- labelsRemoved : 0 ,
514
- indexesAdded : 0 ,
515
- indexesRemoved : 0 ,
516
- constraintsAdded : 1 ,
517
- constraintsRemoved : 0
518
- }
519
- )
515
+ const query =
516
+ protocolVersion > 4.2
517
+ ? 'CREATE CONSTRAINT FOR (book:Book) REQUIRE book.isbn IS UNIQUE'
518
+ : 'CREATE CONSTRAINT ON (book:Book) ASSERT book.isbn IS UNIQUE'
519
+ await verifyUpdates ( runnable , query , null , {
520
+ nodesCreated : 0 ,
521
+ nodesDeleted : 0 ,
522
+ relationshipsCreated : 0 ,
523
+ relationshipsDeleted : 0 ,
524
+ propertiesSet : 0 ,
525
+ labelsAdded : 0 ,
526
+ labelsRemoved : 0 ,
527
+ indexesAdded : 0 ,
528
+ indexesRemoved : 0 ,
529
+ constraintsAdded : 1 ,
530
+ constraintsRemoved : 0
531
+ } )
520
532
}
521
533
522
534
/**
@@ -535,31 +547,32 @@ describe('#integration-rx summary', () => {
535
547
// first create the to-be-dropped index
536
548
const session = driver . session ( )
537
549
try {
538
- await session . run (
539
- 'CREATE CONSTRAINT ON (book:Book) ASSERT book.isbn IS UNIQUE'
540
- )
550
+ const query =
551
+ protocolVersion > 4.2
552
+ ? 'CREATE CONSTRAINT FOR (book:Book) REQUIRE book.isbn IS UNIQUE'
553
+ : 'CREATE CONSTRAINT ON (book:Book) ASSERT book.isbn IS UNIQUE'
554
+ await session . run ( query )
541
555
} finally {
542
556
await session . close ( )
543
557
}
544
558
545
- await verifyUpdates (
546
- runnable ,
547
- 'DROP CONSTRAINT ON (book:Book) ASSERT book.isbn IS UNIQUE' ,
548
- null ,
549
- {
550
- nodesCreated : 0 ,
551
- nodesDeleted : 0 ,
552
- relationshipsCreated : 0 ,
553
- relationshipsDeleted : 0 ,
554
- propertiesSet : 0 ,
555
- labelsAdded : 0 ,
556
- labelsRemoved : 0 ,
557
- indexesAdded : 0 ,
558
- indexesRemoved : 0 ,
559
- constraintsAdded : 0 ,
560
- constraintsRemoved : 1
561
- }
562
- )
559
+ const query =
560
+ protocolVersion > 4.2
561
+ ? 'DROP CONSTRAINT FOR (book:Book) REQUIRE book.isbn IS UNIQUE'
562
+ : 'DROP CONSTRAINT ON (book:Book) ASSERT book.isbn IS UNIQUE'
563
+ await verifyUpdates ( runnable , query , null , {
564
+ nodesCreated : 0 ,
565
+ nodesDeleted : 0 ,
566
+ relationshipsCreated : 0 ,
567
+ relationshipsDeleted : 0 ,
568
+ propertiesSet : 0 ,
569
+ labelsAdded : 0 ,
570
+ labelsRemoved : 0 ,
571
+ indexesAdded : 0 ,
572
+ indexesRemoved : 0 ,
573
+ constraintsAdded : 0 ,
574
+ constraintsRemoved : 1
575
+ } )
563
576
}
564
577
565
578
/**
0 commit comments