Repository: dotnet/efcore
File: test/EFCore.SqlServer.FunctionalTests/Migrations/MigrationsSqlServerTest.cs (C#)

Code before:
            {
                var table = Assert.Single(model.Tables);
                var index = Assert.Single(table.Indexes);
                Assert.Same(table.Columns.Single(c => c.Name == "Name"), Assert.Single(index.Columns));
                Assert.False(index.IsUnique);
                Assert.Null(index.Filter);
            });

        AssertSql(
            """
DECLARE @var2 nvarchar(max);
SELECT @var2 = QUOTENAME([d].[name])
FROM [sys].[default_constraints] [d]
INNER JOIN [sys].[columns] [c] ON [d].[parent_column_id] = [c].[column_id] AND [d].[parent_object_id] = [c].[object_id]
WHERE ([d].[parent_object_id] = OBJECT_ID(N'[People]') AND [c].[name] = N'Name');
IF @var2 IS NOT NULL EXEC(N'ALTER TABLE [People] DROP CONSTRAINT ' + @var2 + ';');
ALTER TABLE [People] ALTER COLUMN [Name] nvarchar(450) NULL;
""",
            //
            """
ALTER TABLE [People] ADD INDEX [IX_People_Name] NONCLUSTERED ([Name]);
""");
    }

    [ConditionalFact, SqlServerCondition(SqlServerCondition.SupportsMemoryOptimized)]
    [PlatformSkipCondition(TestUtilities.Xunit.TestPlatform.Mac)] // TODO: see #37647
    public virtual async Task Create_index_memoryOptimized_unique_nonclustered_not_nullable()
    {
        await Test(
            builder => builder.Entity(
                "People", e =>
                {
                    e.Property<string>("Name").IsRequired();
                    e.ToTable(tb => tb.IsMemoryOptimized());
                    e.ToTable(tb => tb.IsMemoryOptimized());
                    e.HasKey("Name").IsClustered(false);
                }),
            builder => { },
            builder => builder.Entity("People").HasIndex("Name").IsUnique().IsClustered(false),
            model =>
            {
                var table = Assert.Single(model.Tables);
                var index = Assert.Single(table.Indexes);
                Assert.Same(table.Columns.Single(c => c.Name == "Name"), Assert.Single(index.Columns));
                Assert.True(index.IsUnique);
            });

        AssertSql(
            """
ALTER TABLE [People] ADD INDEX [IX_People_Name] UNIQUE NONCLUSTERED ([Name]);
""");

Review comment (bug):
Consider setting `SkipReason` on `PlatformSkipCondition` (e.g. mentioning #37647 and the SQL Server crash under Rosetta). Otherwise the test runner will report the generic default skip reason and the inline `// TODO` comment won’t show up in CI results.
```suggestion
    [PlatformSkipCondition(
        TestUtilities.Xunit.TestPlatform.Mac,
        SkipReason = "SQL Server crashes under Rosetta on macOS; see #37647.")]
```

Code after:
                    e.ToTable(tb => tb.IsMemoryOptimized());
                    e.HasKey("Id").IsClustered(false);
                }),
            builder => { },
            builder => builder.Entity("People").HasIndex("Name").IsUnique().HasFilter("[Name] IS NOT NULL AND <> ''"),
            model =>
            {
                var table = Assert.Single(model.Tables);
                var index = Assert.Single(table.Indexes);
                Assert.Same(table.Columns.Single(c => c.Name == "Name"), Assert.Single(index.Columns));
                Assert.False(index.IsUnique);
                Assert.Null(index.Filter);
            });

        AssertSql(
            """
DECLARE @var2 nvarchar(max);
SELECT @var2 = QUOTENAME([d].[name])
FROM [sys].[default_constraints] [d]
INNER JOIN [sys].[columns] [c] ON [d].[parent_column_id] = [c].[column_id] AND [d].[parent_object_id] = [c].[object_id]
WHERE ([d].[parent_object_id] = OBJECT_ID(N'[People]') AND [c].[name] = N'Name');
IF @var2 IS NOT NULL EXEC(N'ALTER TABLE [People] DROP CONSTRAINT ' + @var2 + ';');
ALTER TABLE [People] ALTER COLUMN [Name] nvarchar(450) NULL;
""",
            //
            """
ALTER TABLE [People] ADD INDEX [IX_People_Name] NONCLUSTERED ([Name]);
""");
    }

    [ConditionalFact, SqlServerCondition(SqlServerCondition.SupportsMemoryOptimized)]
    [PlatformSkipCondition(
        TestUtilities.Xunit.TestPlatform.Mac,
        SkipReason = "SQL Server crashes under Rosetta on macOS; see #37647")]
    public virtual async Task Create_index_memoryOptimized_unique_nonclustered_not_nullable()
    {
        await Test(
            builder => builder.Entity(
                "People", e =>
                {
                    e.Property<string>("Name").IsRequired();
                    e.ToTable(tb => tb.IsMemoryOptimized());
                    e.ToTable(tb => tb.IsMemoryOptimized());
                    e.HasKey("Name").IsClustered(false);
                }),
            builder => { },
            builder => builder.Entity("People").HasIndex("Name").IsUnique().IsClustered(false),
            model =>
            {
                var table = Assert.Single(model.Tables);
                var index = Assert.Single(table.Indexes);