Пример #1
0
        public bool Install()
        {
            var  inspector  = new DbInspector(this.Tenant);
            bool hasDb      = inspector.HasDb();
            bool canInstall = inspector.IsWellKnownDb();

            if (hasDb)
            {
                Log.Verbose($"No need to create database \"{this.Tenant}\" because it already exists.");
            }

            if (!canInstall)
            {
                Log.Verbose(
                    $"Cannot create a database under the name \"{this.Tenant}\" because the name is not a well-known tenant name.");
            }

            if (!hasDb && canInstall)
            {
                Log.Information($"Creating database \"{this.Tenant}\".");
                this.CreateDb();
                return(true);
            }

            return(false);
        }
Пример #2
0
        public bool Install()
        {
            var inspector = new DbInspector(this.Catalog);
            bool hasDb = inspector.HasDb();
            bool canInstall = inspector.IsWellKnownDb();

            if (!hasDb && canInstall)
            {
                return this.CreateDb();
            }

            return false;
        }
Пример #3
0
        public bool Install()
        {
            var  inspector  = new DbInspector(this.Catalog);
            bool hasDb      = inspector.HasDb();
            bool canInstall = inspector.IsWellKnownDb();

            if (!hasDb && canInstall)
            {
                return(this.CreateDb());
            }

            return(false);
        }