Skip to content

Commit 6dca3ed

Browse files
author
Azure Pipelines
committed
Publish GitHub Pages
1 parent 8b5ef60 commit 6dca3ed

File tree

4 files changed

+160
-145
lines changed

4 files changed

+160
-145
lines changed

articles/extensions/sql-server-extensions.html

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,21 @@ <h3 id="create-a-unique-constraint-with-a-clustered-index">Create a unique const
9999
<pre><code class="lang-cs">Create.UniqueConstraint(&quot;UQ&quot;).OnTable(&quot;TestTable&quot;).Column(&quot;Name&quot;).Clustered();
100100
</code></pre>
101101
<p>Note: You have to create the primary key index or unique constraint separately from the Create.Table expression to be able to specify them as clustered or non-clustered.</p>
102+
<h3 id="create-a-unique-constraint-on-nullable-columns-using-null-value-filter">Create a unique constraint on nullable columns using null value filter</h3>
103+
<p>Note: SQL Server has a different approach to creating unique constraints on nullable columns than ANSI standard.</p>
104+
<pre><code class="lang-cs">Create.Index(&quot;UQ_NullFilter&quot;)
105+
.OnTable(&quot;TestTable&quot;).InSchema(&quot;dbo&quot;)
106+
.OnColumn(&quot;Name&quot;).Ascending()
107+
.WithOptions().Unique()
108+
.WithOptions().Filter(&quot;[Name] IS NOT NULL&quot;);
109+
</code></pre>
110+
<p>This will generate the following T-SQL DDL statement:</p>
111+
<pre><code class="lang-sql">CREATE UNIQUE NONCLUSTERED INDEX [UQ_NullFilter] ON [dbo].[TestTable]
112+
(
113+
[Name] ASC
114+
)
115+
WHERE ([Name] IS NOT NULL)
116+
</code></pre>
102117
<h2 id="create-a-column-of-sql-data-type-nvarcharmax--varcharmax">Create a column of SQL data type <code>nvarchar(MAX)</code> / <code>varchar(MAX)</code></h2>
103118
<p>Use <code>int.MaxValue</code> to represent infinite length strings.</p>
104119
<pre><code class="lang-cs">Create.Column(&quot;Name&quot;).OnTable(&quot;TestTable&quot;).AsString(int.MaxValue);

articles/guides/upgrades/guide-2.0-to-3.0.html

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ <h2 id="custom-migration-expression-validation">Custom migration expression vali
136136
<p>This feature allows - for example - forbidding data deletions in a production environment.</p>
137137
<h2 id="using-systemcomponentmodeldataannotations-for-validation">Using <code>System.ComponentModel.DataAnnotations</code> for validation</h2>
138138
<h1 id="breaking-changes">Breaking Changes</h1>
139-
<p>Version 3.0 dropped support for all .NET Framework versions below 4.6.1 and the timeout values are now stored as <a class="xref" href="https://docs.microsoft.com/dotnet/api/system.timespan">TimeSpan</a> rather than an <code>int</code> (of seconds).</p>
139+
<p>Version 3.0 dropped support for all .NET Framework versions below 4.6.1 and the timeout values are now stored as <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.timespan">TimeSpan</a> rather than an <code>int</code> (of seconds).</p>
140140
<h2 id="minimum-net-framework-461">Minimum: .NET Framework 4.6.1</h2>
141141
<p>Dropping the support for all .NET Framework versions below 4.6.1 was required, because the package now relies on the following libraries:</p>
142142
<ul>
@@ -145,7 +145,7 @@ <h2 id="minimum-net-framework-461">Minimum: .NET Framework 4.6.1</h2>
145145
<li><a href="https://github.com/aspnet/Logging/">Microsoft.Extensions.Logging</a></li>
146146
<li><a href="https://github.com/aspnet/Configuration/">Microsoft.Extensions.Configuration</a></li>
147147
</ul>
148-
<h2 id="processoroptionstimeout-is-now-a-timespan"><code>ProcessorOptions.Timeout</code> is now a <a class="xref" href="https://docs.microsoft.com/dotnet/api/system.timespan">TimeSpan</a></h2>
148+
<h2 id="processoroptionstimeout-is-now-a-timespan"><code>ProcessorOptions.Timeout</code> is now a <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.timespan">TimeSpan</a></h2>
149149
<p>This change is part of the ongoing effort to make the API easier to understand, because it might not be clear if an <code>int timeout</code> is the timeout in milliseconds, seconds, et cetera. Previously the <code>int</code> value corresponded to seconds.</p>
150150
<h2 id="icanbevalidated-not-used-anymore"><code>ICanBeValidated</code> not used anymore</h2>
151151
<p>The library now uses <code>System.ComponentModel.DataAnnotations</code> for validation - for example the <code>[Required]</code> attribute for expression fields that are - one might've guessed it - required.</p>
@@ -255,7 +255,7 @@ <h4 id="obsolete-api-1">Obsolete API</h4>
255255
<li>Re-inventing the wheel</li>
256256
</ul>
257257
<h2 id="iannouncer"><code>IAnnouncer</code></h2>
258-
<p>The <a href="xref:FluentMigrator.Runner.IAnnouncer">IAnnouncer</a> interface (and its implementations) were replaced by <a class="xref" href="https://docs.microsoft.com/dotnet/api/microsoft.extensions.logging.ilogger">ILogger</a> and its implementations.</p>
258+
<p>The <a href="xref:FluentMigrator.Runner.IAnnouncer">IAnnouncer</a> interface (and its implementations) were replaced by <a class="xref" href="https://learn.microsoft.com/dotnet/api/microsoft.extensions.logging.ilogger">ILogger</a> and its implementations.</p>
259259
<h3 id="logger-registration">Logger registration</h3>
260260
<p>You can comfortably register the default <a href="xref:FluentMigrator.Runner.Logging.FluentMigratorConsoleLogger">FluentMigratorConsoleLogger</a>:</p>
261261
<pre><code class="lang-cs">var serviceProvider = new ServiceCollection()
@@ -289,7 +289,7 @@ <h5>Important</h5>
289289
.BuildServiceProvider();
290290
</code></pre>
291291
<h3 id="logger-usage">Logger usage</h3>
292-
<p>You don't use the loggers directly any more. Instead, you just create a constructor parameter with a type of <a class="xref" href="https://docs.microsoft.com/dotnet/api/microsoft.extensions.logging.ilogger">ILogger</a> or <a class="xref" href="https://docs.microsoft.com/dotnet/api/microsoft.extensions.logging.ilogger-1">ILogger</a>.</p>
292+
<p>You don't use the loggers directly any more. Instead, you just create a constructor parameter with a type of <a class="xref" href="https://learn.microsoft.com/dotnet/api/microsoft.extensions.logging.ilogger">ILogger</a> or <a class="xref" href="https://learn.microsoft.com/dotnet/api/microsoft.extensions.logging.ilogger-1">ILogger</a>.</p>
293293
<pre><code class="lang-cs">public class MyMigration : ForwardOnlyMigration {
294294
private readonly ILogger&lt;MyMigration&gt; _logger;
295295

@@ -306,7 +306,7 @@ <h3 id="other-loggers">Other loggers</h3>
306306
<p>There are several other loggers, like:</p>
307307
<ul>
308308
<li><a href="xref:FluentMigrator.Runner.Logging.LogFileFluentMigratorLoggerProvider">LogFileFluentMigratorLoggerProvider</a> for logging SQL statements into a file</li>
309-
<li><a href="xref:FluentMigrator.Runner.Logging.SqlScriptFluentMigratorLoggerProvider">SqlScriptFluentMigratorLoggerProvider</a> for logging SQL statements into a <a class="xref" href="https://docs.microsoft.com/dotnet/api/system.io.textwriter">TextWriter</a></li>
309+
<li><a href="xref:FluentMigrator.Runner.Logging.SqlScriptFluentMigratorLoggerProvider">SqlScriptFluentMigratorLoggerProvider</a> for logging SQL statements into a <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.textwriter">TextWriter</a></li>
310310
</ul>
311311
<h4 id="registration-of-logfilefluentmigratorloggerprovider">Registration of <a href="xref:FluentMigrator.Runner.Logging.LogFileFluentMigratorLoggerProvider">LogFileFluentMigratorLoggerProvider</a></h4>
312312
<pre><code class="lang-cs">var serviceProvider = new ServiceCollection()
@@ -357,8 +357,8 @@ <h3 id="properties-moved-into-appconfigconnectionstringaccessoroptions">Properti
357357
<div class="WARNING">
358358
<h5>Warning</h5>
359359
<p>This class only works under the full .NET Framework and is marked as obsolete!
360-
Provide access to an <a class="xref" href="https://docs.microsoft.com/dotnet/api/microsoft.extensions.configuration.iconfiguration">IConfiguration</a> service.
361-
The FluentMigrator library will use it to call the <a class="xref" href="https://docs.microsoft.com/dotnet/api/microsoft.extensions.configuration.configurationextensions.getconnectionstring#microsoft-extensions-configuration-configurationextensions-getconnectionstring(microsoft-extensions-configuration-iconfiguration-system-string)">GetConnectionString</a> extension method.</p>
360+
Provide access to an <a class="xref" href="https://learn.microsoft.com/dotnet/api/microsoft.extensions.configuration.iconfiguration">IConfiguration</a> service.
361+
The FluentMigrator library will use it to call the <a class="xref" href="https://learn.microsoft.com/dotnet/api/microsoft.extensions.configuration.configurationextensions.getconnectionstring#microsoft-extensions-configuration-configurationextensions-getconnectionstring(microsoft-extensions-configuration-iconfiguration-system-string)">GetConnectionString</a> extension method.</p>
362362
</div>
363363
<ul>
364364
<li><a href="xref:FluentMigrator.Runner.Initialization.NetFramework.AppConfigConnectionStringAccessorOptions.ConnectionStringConfigPath">ConnectionStringPath ➔ ConnectionStringConfigPath</a></li>
@@ -373,7 +373,7 @@ <h3 id="properties-moved-into-assemblysourceoptions">Properties moved into <a hr
373373
</ul>
374374
<h3 id="properties-with-no-direct-replacement">Properties with no direct replacement</h3>
375375
<ul>
376-
<li><code>Announcer</code>: Get your <a class="xref" href="https://docs.microsoft.com/dotnet/api/microsoft.extensions.logging.ilogger">ILogger</a> with dependency injection instead</li>
376+
<li><code>Announcer</code>: Get your <a class="xref" href="https://learn.microsoft.com/dotnet/api/microsoft.extensions.logging.ilogger">ILogger</a> with dependency injection instead</li>
377377
<li><code>StopWatch</code>: Get your <a href="xref:FluentMigrator.Runner.IStopWatch">IStopWatch</a> with dependency injection instead</li>
378378
</ul>
379379
<h3 id="workingdirectory">WorkingDirectory</h3>

0 commit comments

Comments
 (0)