예제 #1
0
        public void MigrateScript(ScriptOptions options)
        {
            Prepare(options, "Script");
            PrintMigrationGroup(options);

            var runner = new ScriptCreatorRunner(SharpFactory.Default.CreateDataClient(), GetAssemblyWithMigrations(options), options.MigrationGroup);

            runner.Run(options.TargetVersion);
            File.WriteAllText(options.Filename, runner.GetCreatedScript(), Encoding.UTF8);
            Console.WriteLine(
                $" * Check {options.Filename} for the script dump. No migrations were performed this time.");
        }
예제 #2
0
        private void RunScript(int version)
        {
            if (String.IsNullOrEmpty(Options.Filename))
            {
                Exit();
            }
            var runner = new ScriptCreatorRunner(SharpFactory.Default.CreateDataClient(), GetAssemblyWithMigrations());

            runner.Run(version, Options.MigrationGroup);
            File.WriteAllText(Options.Filename, runner.GetCreatedScript(), Encoding.UTF8);
            Console.WriteLine(" * Check {0} for the script dump. No migrations were performed on the database.",
                              Options.Filename);
        }