Beispiel #1
0
        private void WriteDatabaseSchemaGenerationScript(string directory, FileSystem system)
        {
            var allSchemaNames = AllSchemaNames();
            var script         = DatabaseSchemaGenerator.GenerateScript(allSchemaNames);

            if (script.IsNotEmpty())
            {
                var filename = directory.AppendPath("database_schemas.sql");
                system.WriteStringToFile(filename, script);
            }
        }
Beispiel #2
0
        private void writeDatabaseSchemaGenerationScript(string directory, FileSystem system, ISchemaObjects[] schemaObjects)
        {
            var allSchemaNames = AllSchemaNames();
            var script         = DatabaseSchemaGenerator.GenerateScript(StoreOptions, allSchemaNames);

            var writer = new StringWriter();

            if (script.IsNotEmpty())
            {
                writer.WriteLine(script);

                writer.WriteLine();
            }

            foreach (var schemaObject in schemaObjects)
            {
                writer.WriteLine($"\\i {schemaObject.Name}.sql");
            }

            var filename = directory.AppendPath("all.sql");

            system.WriteStringToFile(filename, writer.ToString());
        }