Esempio n. 1
0
 internal virtual void DeleteAllIndexRules()
 {
     foreach (IndexDefinition index in Db.schema().Indexes)
     {
         if (!index.ConstraintIndex)
         {
             index.Drop();
         }
     }
 }
Esempio n. 2
0
 private void CreateIndex(Label label, string key)
 {
     using (Transaction tx = _db.beginTx())
     {
         _db.schema().indexFor(label).on(key).create();
         tx.Success();
     }
     using (Transaction tx = _db.beginTx())
     {
         _db.schema().awaitIndexesOnline(10, SECONDS);
         tx.Success();
     }
 }
Esempio n. 3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldRecoverCreationOfUniquenessConstraintFollowedByDeletionOfThatSameConstraint() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldRecoverCreationOfUniquenessConstraintFollowedByDeletionOfThatSameConstraint()
        {
            // given
            CreateUniqueConstraint();
            DropConstraints();

            // when - perform recovery
            Restart(Snapshot(StoreDir.absolutePath()));

            // then - just make sure the constraint is gone
            using (Transaction tx = _db.beginTx())
            {
                assertFalse(_db.schema().getConstraints(_label).GetEnumerator().hasNext());
                tx.Success();
            }
        }
Esempio n. 4
0
 private void CreatePropertyIndex()
 {
     using (Transaction tx = _graphDb.beginTx())
     {
         _graphDb.schema().indexFor(Label).on(PROP_NAME).create();
         tx.Success();
     }
 }
Esempio n. 5
0
 public override Schema Schema()
 {
     return(GraphDatabaseAPI.schema());
 }