You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<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
+
<h3id="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>
.WithOptions().Filter("[Name] IS NOT NULL");
109
+
</code></pre>
110
+
<p>This will generate the following T-SQL DDL statement:</p>
111
+
<pre><codeclass="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>
102
117
<h2id="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>
103
118
<p>Use <code>int.MaxValue</code> to represent infinite length strings.</p>
<p>This feature allows - for example - forbidding data deletions in a production environment.</p>
137
137
<h2id="using-systemcomponentmodeldataannotations-for-validation">Using <code>System.ComponentModel.DataAnnotations</code> for validation</h2>
138
138
<h1id="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 <aclass="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 <aclass="xref" href="https://learn.microsoft.com/dotnet/api/system.timespan">TimeSpan</a> rather than an <code>int</code> (of seconds).</p>
<h2id="processoroptionstimeout-is-now-a-timespan"><code>ProcessorOptions.Timeout</code> is now a <aclass="xref" href="https://docs.microsoft.com/dotnet/api/system.timespan">TimeSpan</a></h2>
148
+
<h2id="processoroptionstimeout-is-now-a-timespan"><code>ProcessorOptions.Timeout</code> is now a <aclass="xref" href="https://learn.microsoft.com/dotnet/api/system.timespan">TimeSpan</a></h2>
149
149
<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>
150
150
<h2id="icanbevalidated-not-used-anymore"><code>ICanBeValidated</code> not used anymore</h2>
151
151
<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>
<p>The <ahref="xref:FluentMigrator.Runner.IAnnouncer">IAnnouncer</a> interface (and its implementations) were replaced by <aclass="xref" href="https://docs.microsoft.com/dotnet/api/microsoft.extensions.logging.ilogger">ILogger</a> and its implementations.</p>
258
+
<p>The <ahref="xref:FluentMigrator.Runner.IAnnouncer">IAnnouncer</a> interface (and its implementations) were replaced by <aclass="xref" href="https://learn.microsoft.com/dotnet/api/microsoft.extensions.logging.ilogger">ILogger</a> and its implementations.</p>
<p>You can comfortably register the default <ahref="xref:FluentMigrator.Runner.Logging.FluentMigratorConsoleLogger">FluentMigratorConsoleLogger</a>:</p>
261
261
<pre><codeclass="lang-cs">var serviceProvider = new ServiceCollection()
@@ -289,7 +289,7 @@ <h5>Important</h5>
289
289
.BuildServiceProvider();
290
290
</code></pre>
291
291
<h3id="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 <aclass="xref" href="https://docs.microsoft.com/dotnet/api/microsoft.extensions.logging.ilogger">ILogger</a> or <aclass="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 <aclass="xref" href="https://learn.microsoft.com/dotnet/api/microsoft.extensions.logging.ilogger">ILogger</a> or <aclass="xref" href="https://learn.microsoft.com/dotnet/api/microsoft.extensions.logging.ilogger-1">ILogger</a>.</p>
293
293
<pre><codeclass="lang-cs">public class MyMigration : ForwardOnlyMigration {
<li><ahref="xref:FluentMigrator.Runner.Logging.LogFileFluentMigratorLoggerProvider">LogFileFluentMigratorLoggerProvider</a> for logging SQL statements into a file</li>
309
-
<li><ahref="xref:FluentMigrator.Runner.Logging.SqlScriptFluentMigratorLoggerProvider">SqlScriptFluentMigratorLoggerProvider</a> for logging SQL statements into a <aclass="xref" href="https://docs.microsoft.com/dotnet/api/system.io.textwriter">TextWriter</a></li>
309
+
<li><ahref="xref:FluentMigrator.Runner.Logging.SqlScriptFluentMigratorLoggerProvider">SqlScriptFluentMigratorLoggerProvider</a> for logging SQL statements into a <aclass="xref" href="https://learn.microsoft.com/dotnet/api/system.io.textwriter">TextWriter</a></li>
310
310
</ul>
311
311
<h4id="registration-of-logfilefluentmigratorloggerprovider">Registration of <ahref="xref:FluentMigrator.Runner.Logging.LogFileFluentMigratorLoggerProvider">LogFileFluentMigratorLoggerProvider</a></h4>
312
312
<pre><codeclass="lang-cs">var serviceProvider = new ServiceCollection()
<p>This class only works under the full .NET Framework and is marked as obsolete!
360
-
Provide access to an <aclass="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 <aclass="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 <aclass="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 <aclass="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>
@@ -373,7 +373,7 @@ <h3 id="properties-moved-into-assemblysourceoptions">Properties moved into <a hr
373
373
</ul>
374
374
<h3id="properties-with-no-direct-replacement">Properties with no direct replacement</h3>
375
375
<ul>
376
-
<li><code>Announcer</code>: Get your <aclass="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 <aclass="xref" href="https://learn.microsoft.com/dotnet/api/microsoft.extensions.logging.ilogger">ILogger</a> with dependency injection instead</li>
377
377
<li><code>StopWatch</code>: Get your <ahref="xref:FluentMigrator.Runner.IStopWatch">IStopWatch</a> with dependency injection instead</li>
0 commit comments