Esempio n. 1
0
        public override MigrationResult Migrate(DatabaseStatus preSchemaUpdateStatus)
        {
            int updatedItems = 0;

            using (var transaction = repository.BeginTransaction())
            {
                foreach (var item in installer.ExecuteQuery(InstallationManager.QueryItemsWithoutAncestralTrail))
                {
                    item.AncestralTrail = Utility.GetTrail(item.Parent);
                    repository.SaveOrUpdate(item);
                    updatedItems++;
                }

                transaction.Commit();
            }

            return(new MigrationResult(this)
            {
                UpdatedItems = updatedItems
            });
        }
Esempio n. 2
0
        public override MigrationResult Migrate(DatabaseStatus preSchemaUpdateStatus)
        {
            int updatedItems = 0;

            using (var transaction = repository.BeginTransaction())
            {
                foreach (var item in installer.ExecuteQuery(InstallationManager.QueryItemsWithAuthorizedRoles))
                {
                    item.AlteredPermissions |= Permission.Read;
                    repository.Update(item);
                    updatedItems++;
                }

                transaction.Commit();
            }

            return(new MigrationResult(this)
            {
                UpdatedItems = updatedItems
            });
        }