public override bool VisitSchemaRuleCommand(Command.SchemaRuleCommand command)
        {
            SchemaStore schemaStore = _neoStores.SchemaStore;

            if (_version == CommandVersion.BEFORE)
            {
                // We are doing reverse-recovery. There is no need for updating the cache, since the indexing service be told what it needs to know when we do
                // forward-recovery later.
                bool create = command.Mode == Command.Mode.Create;
                foreach (DynamicRecord record in command.RecordsBefore)
                {
                    if (create)
                    {
                        // Schema create commands do not properly store their before images, so we need to correct them.
                        // That is, if the schema was created by this command, then obviously the before image of those records were not in use.
                        record.InUse = false;
                    }
                    schemaStore.UpdateRecord(record);
                }
                return(false);
            }

            // schema rules. Execute these after generating the property updates so. If executed
            // before and we've got a transaction that sets properties/labels as well as creating an index
            // we might end up with this corner-case:
            // 1) index rule created and index population job started
            // 2) index population job processes some nodes, but doesn't complete
            // 3) we gather up property updates and send those to the indexes. The newly created population
            //    job might get those as updates
            // 4) the population job will apply those updates as added properties, and might end up with duplicate
            //    entries for the same property
            foreach (DynamicRecord record in command.RecordsAfter)
            {
                schemaStore.UpdateRecord(record);
            }

            if (command.SchemaRule is ConstraintRule)
            {
                switch (command.Mode)
                {
                case UPDATE:
                case CREATE:
                    _neoStores.MetaDataStore.LatestConstraintIntroducingTx = _transactionId;
                    break;

                case DELETE:
                    break;

                default:
                    throw new System.InvalidOperationException(command.Mode.name());
                }
            }

            switch (command.Mode)
            {
            case DELETE:
                _cacheAccess.removeSchemaRuleFromCache(command.Key);
                break;

            default:
                _cacheAccess.addSchemaRule(command.SchemaRule);
                break;
            }
            return(false);
        }