![](/img/trans.png)
[英]In SQL Server / Liquibase, does INSERT query create a table, automatically without CREATE schema, if it does not exist?
[英]NServiceBus doesn't automatically create schema (SQL Server)
我希望我的 NServiceBus 傳奇存在於單獨的 SQL Server 架構中。 為 sagas 創建表的自動生成的 SQL 腳本確實使用自定義模式名稱,但如果模式不存在,則不會創建模式,因此必須事先手動創建模式。
這是設計使然嗎? 在執行自動生成的 SQL 之前,是否有一個鈎子可以用來包含創建模式的自定義代碼?
配置如下所示:
public EndpointConfiguration Configure(EndpointConfiguration configuration)
{
if (configuration == null) throw new ArgumentNullException(nameof(configuration));
var persistence = configuration.UsePersistence<SqlPersistence>();
persistence.SqlDialect<SqlDialect.MsSqlServer>().Schema("nsb");
persistence.TablePrefix(string.Empty);
persistence.ConnectionBuilder(() => new SqlConnection(_configuration.GetConnectionString("<ConnectionStringName>")));
return configuration;
}
SQL Persister 假定在執行腳本之前目錄和模式已經存在。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.