예제 #1
0
        internal DatabaseSchemaResult ValidateDatabaseSchema()
        {
            if (_configured == false || (string.IsNullOrEmpty(_connectionString) || string.IsNullOrEmpty(ProviderName)))
            {
                return(new DatabaseSchemaResult());
            }

            if (_result == null)
            {
                var database = new UmbracoDatabase(_connectionString, ProviderName);
                var dbSchema = new DatabaseSchemaCreation(database);
                _result = dbSchema.ValidateSchema();
            }
            return(_result);
        }
예제 #2
0
        internal DatabaseSchemaResult ValidateDatabaseSchema()
        {
            if (_configured == false || (string.IsNullOrEmpty(_connectionString) || string.IsNullOrEmpty(ProviderName)))
            {
                return(new DatabaseSchemaResult());
            }

            if (_result == null)
            {
                if (SystemUtilities.GetCurrentTrustLevel() != AspNetHostingPermissionLevel.Unrestricted &&
                    ProviderName == Constants.DatabaseProviders.MySql)
                {
                    throw new InvalidOperationException("Cannot use MySql in Medium Trust configuration");
                }

                var database = new UmbracoDatabase(_connectionString, ProviderName, _logger);
                var dbSchema = new DatabaseSchemaCreation(database, _logger, SqlSyntax);
                _result = dbSchema.ValidateSchema();
            }
            return(_result);
        }