Dbup 是否支持 azure datawarehouse DB?当我尝试运行 c# 控制台项目时,即使对于 select 语句,我也收到以下错误,有什么建议吗?除了 dacpac 之外,是否有任何替代的 sql 自动化版本,如 dbup。
[error]Script block number: -1; Message: Enforced unique constraints are not supported in Azure SQL Data Warehouse. To create an unenforced unique constraint you must include the NOT ENFORCED syntax as part of your statement.
[error]System.Data.SqlClient.SqlException (0x80131904): Enforced unique constraints are not supported in Azure SQL Data Warehouse. To create an unenforced unique constraint you must include the NOT ENFORCED syntax as part of your statement.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
program.cs
``
using DbUp;
using System;``
using System.Configuration;
using System.Reflection;
namespace MIReport.Warehouse
{
class Program
{
static int Main(string[] args)
{
var connectionString = @"Server=tcp:" + args[0] + ",1433;Initial Catalog=" + args[1] + ";Persist Security Info=False;User ID=" + args[2] + ";Password=" + args[3] + ";MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Authentication='Active Directory Password';";
var upgrader = DeployChanges.To
.SqlDatabase(connectionString)
.WithScriptsEmbeddedInAssembly(Assembly.GetExecutingAssembly())
.LogToConsole()
.LogScriptOutput()
.Build();
var result = upgrader.PerformUpgrade();
if (!result.Successful)
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine(result.Error);
Console.ResetColor();
return -1;
}
Console.ForegroundColor = ConsoleColor.Green;
Console.WriteLine("Success!");
Console.ResetColor();
return 0;
}
}
}