Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/dbup-sqlserver/AzureSqlConnectionManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ namespace DbUp.SqlServer;
/// <summary>Manages an Azure Sql Server database connection.</summary>
public class AzureSqlConnectionManager : DatabaseConnectionManager
{
/// <summary>
/// Initializes a new instance of the <see cref="AzureSqlConnectionManager"/> class using a connection string and an Azure token credential.
/// </summary>
/// <param name="connectionString">The SQL connection string.</param>
/// <param name="tokenCredential">The Azure token credential used for authentication.</param>
/// <param name="resource">The resource URI for Azure SQL authentication.</param>
/// <param name="tenantId">Optional tenant ID for multi-tenant authentication scenarios.</param>
public AzureSqlConnectionManager(
string connectionString,
TokenCredential tokenCredential,
Expand All @@ -34,6 +41,7 @@ public AzureSqlConnectionManager(
{
}

/// <inheritdoc/>
public override IEnumerable<string> SplitScriptIntoCommands(string scriptContents)
{
var commandSplitter = new SqlCommandSplitter();
Expand Down
1 change: 1 addition & 0 deletions src/dbup-sqlserver/Helpers/TemporarySqlDatabase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public TemporarySqlDatabase(string name) : this(name, localSqlInstance) { }
/// Initializes a new instance of the <see cref="TemporarySqlDatabase"/> class.
/// </summary>
/// <param name="name">The name.</param>
/// <param name="instanceName">The name of the instance.</param>
public TemporarySqlDatabase(string name, string instanceName) :
this(new SqlConnectionStringBuilder($"Server={instanceName};Database={name};Trusted_connection=true;Pooling=false"))
{
Expand Down
1 change: 1 addition & 0 deletions src/dbup-sqlserver/SqlConnectionManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public SqlConnectionManager(string connectionString)
}))
{ }

/// <inheritdoc/>
public override IEnumerable<string> SplitScriptIntoCommands(string scriptContents)
{
var commandSplitter = new SqlCommandSplitter();
Expand Down
2 changes: 2 additions & 0 deletions src/dbup-sqlserver/SqlScriptExecutor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@ public SqlScriptExecutor(Func<IConnectionManager> connectionManagerFactory, Func
{
}

/// <inheritdoc/>
protected override string GetVerifySchemaSql(string schema)
{
return string.Format(@"IF NOT EXISTS (SELECT * FROM sys.schemas WHERE name = N'{0}') Exec('CREATE SCHEMA [{0}]')", Schema);
}

/// <inheritdoc/>
protected override void ExecuteCommandsWithinExceptionHandler(int index, SqlScript script, Action executeCommand)
{
try
Expand Down
3 changes: 3 additions & 0 deletions src/dbup-sqlserver/SqlServerObjectParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ namespace DbUp.SqlServer
/// </summary>
public class SqlServerObjectParser : SqlObjectParser
{
/// <summary>
/// Initializes a new instance of the <see cref="SqlServerObjectParser"/> class.
/// </summary>
public SqlServerObjectParser()
: base("[", "]")
{
Expand Down
3 changes: 3 additions & 0 deletions src/dbup-sqlserver/SqlTableJournal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,19 @@ public SqlTableJournal(Func<IConnectionManager> connectionManager, Func<IUpgrade
{
}

/// <inheritdoc/>
protected override string GetInsertJournalEntrySql(string @scriptName, string @applied)
{
return $"insert into {FqSchemaTableName} (ScriptName, Applied) values ({@scriptName}, {@applied})";
}

/// <inheritdoc/>
protected override string GetJournalEntriesSql()
{
return $"select [ScriptName] from {FqSchemaTableName} order by [ScriptName]";
}

/// <inheritdoc/>
protected override string CreateSchemaTableSql(string quotedPrimaryKeyName)
{
return
Expand Down
1 change: 1 addition & 0 deletions src/dbup-sqlserver/dbup-sqlserver.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<SignAssembly>true</SignAssembly>
<RepositoryUrl>https://github.com/DbUp/dbup-sqlserver.git</RepositoryUrl>
<PackageIcon>dbup-icon.png</PackageIcon>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>

<PropertyGroup Condition="'$(CI)' == 'true'">
Expand Down