Пример #1
0
        //public int ExistingSiteCount()
        //{
        //    return db.ExistingSiteCount();
        //}

        public bool NeedsUpgrade(string applicationName)
        {
            IVersionProvider provider = versionProviderFactory.Get(applicationName);

            if (provider == null)
            {
                log.LogInformation("IVersionProvider not found for " + applicationName);
                return(true);
            }

            Version codeVersion = provider.GetCodeVersion();

            Guid    appId         = db.GetOrGenerateSchemaApplicationId(applicationName);
            Version schemaVersion = db.GetSchemaVersion(appId);

            bool result = false;

            if (codeVersion > schemaVersion)
            {
                //log.LogInformation(applicationName + " needs upgrade");
                result = true;
            }

            return(result);
        }
Пример #2
0
        private Guid GetOrGenerateSchemaApplicationId(string applicationName)
        {
            IVersionProvider versionProvider = versionProviderFactory.Get(applicationName);

            if (versionProvider != null)
            {
                return(versionProvider.ApplicationId);
            }

            return(db.GetOrGenerateSchemaApplicationId(applicationName));
        }