blob: 8098647d4aa82379ed5985d45942bac3309adad4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tango.SQLExaminer;
namespace Tango.PPC.SchemaSynchronizer.CLI
{
class Program
{
static void Main(string[] args)
{
Core.DataSource source = new Core.DataSource();
source.Address = "localhost\\SQLEXPRESS";
source.Catalog = "Tango";
Core.DataSource target = new Core.DataSource();
target.Address = "localhost\\SQLPPC";
target.Catalog = "Tango";
ExaminerConfigurationBuilder builder = new ExaminerConfigurationBuilder(ExaminerConfigurationType.Schema);
builder.
SetSource(source).
SetTarget(target).
Synchronize();
var config = builder.Build();
ExaminerProcess process = new ExaminerProcess(config, ExaminerProcessType.Schema);
process.Progress += (x, msg) =>
{
Console.WriteLine(msg);
};
var result = process.Execute().Result;
if (result.ExitCode == ExaminerProcessExitCode.Success)
{
Console.ForegroundColor = ConsoleColor.Green;
Console.WriteLine("Completed!");
}
else
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("Failed!");
}
Console.ReadLine();
}
}
}
|