Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
jobily
Efcore.Pg
提交
40dc0d3c
E
Efcore.Pg
项目概览
jobily
/
Efcore.Pg
12 个月 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
Efcore.Pg
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
40dc0d3c
编写于
12月 29, 2021
作者:
S
Shay Rojansky
提交者:
GitHub
12月 29, 2021
1
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Stop scaffolding index included/covered properties (#2195)
Fixes #2191
上级
126a6b68
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
57 addition
and
38 deletion
+57
-38
src/EFCore.PG/Scaffolding/Internal/NpgsqlDatabaseModelFactory.cs
...ore.PG/Scaffolding/Internal/NpgsqlDatabaseModelFactory.cs
+2
-1
test/EFCore.PG.FunctionalTests/Migrations/MigrationsNpgsqlTest.cs
...ore.PG.FunctionalTests/Migrations/MigrationsNpgsqlTest.cs
+52
-36
test/EFCore.PG.FunctionalTests/Scaffolding/NpgsqlDatabaseModelFactoryTest.cs
...tionalTests/Scaffolding/NpgsqlDatabaseModelFactoryTest.cs
+3
-1
未找到文件。
src/EFCore.PG/Scaffolding/Internal/NpgsqlDatabaseModelFactory.cs
浏览文件 @
40dc0d3c
...
...
@@ -666,7 +666,8 @@ deptype IN ('e', 'x')
}
}
index
[
NpgsqlAnnotationNames
.
IndexInclude
]
=
nonKeyColumns
.
ToArray
();
// Scaffolding included/covered properties is currently blocked, see #2194
// index[NpgsqlAnnotationNames.IndexInclude] = nonKeyColumns.ToArray();
}
if
(
record
.
GetValueOrDefault
<
string
>(
"pred"
)
is
{
}
predicate
)
...
...
test/EFCore.PG.FunctionalTests/Migrations/MigrationsNpgsqlTest.cs
浏览文件 @
40dc0d3c
...
...
@@ -1865,16 +1865,20 @@ public virtual async Task Create_index_with_include()
var
index
=
Assert
.
Single
(
table
.
Indexes
);
Assert
.
Equal
(
1
,
index
.
Columns
.
Count
);
Assert
.
Contains
(
table
.
Columns
.
Single
(
c
=>
c
.
Name
==
"Name"
),
index
.
Columns
);
// Scaffolding included/covered properties is currently blocked, see #2194
var
includedColumns
=
(
string
[])
index
[
NpgsqlAnnotationNames
.
IndexInclude
]!;
if
(
TestEnvironment
.
PostgresVersion
.
AtLeast
(
11
))
{
Assert
.
Contains
(
"FirstName"
,
includedColumns
);
Assert
.
Contains
(
"last_name"
,
includedColumns
);
}
else
{
Assert
.
Null
(
includedColumns
);
}
// if (TestEnvironment.PostgresVersion.AtLeast(11))
// {
// Assert.Contains("FirstName", includedColumns);
// Assert.Contains("last_name", includedColumns);
// }
// else
// {
// Assert.Null(includedColumns);
// }
});
AssertSql
(
TestEnvironment
.
PostgresVersion
.
AtLeast
(
11
)
...
...
@@ -1905,16 +1909,20 @@ public virtual async Task Create_index_with_include_and_filter()
Assert
.
Equal
(
@"(""Name"" IS NOT NULL)"
,
index
.
Filter
);
Assert
.
Equal
(
1
,
index
.
Columns
.
Count
);
Assert
.
Contains
(
table
.
Columns
.
Single
(
c
=>
c
.
Name
==
"Name"
),
index
.
Columns
);
// Scaffolding included/covered properties is currently blocked, see #2194
var
includedColumns
=
(
string
[])
index
[
NpgsqlAnnotationNames
.
IndexInclude
]!;
if
(
TestEnvironment
.
PostgresVersion
.
AtLeast
(
11
))
{
Assert
.
Contains
(
"FirstName"
,
includedColumns
);
Assert
.
Contains
(
"LastName"
,
includedColumns
);
}
else
{
Assert
.
Null
(
includedColumns
);
}
// if (TestEnvironment.PostgresVersion.AtLeast(11))
// {
// Assert.Contains("FirstName", includedColumns);
// Assert.Contains("LastName", includedColumns);
// }
// else
// {
// Assert.Null(includedColumns);
// }
});
AssertSql
(
TestEnvironment
.
PostgresVersion
.
AtLeast
(
11
)
...
...
@@ -1945,16 +1953,20 @@ public virtual async Task Create_index_unique_with_include()
Assert
.
True
(
index
.
IsUnique
);
Assert
.
Equal
(
1
,
index
.
Columns
.
Count
);
Assert
.
Contains
(
table
.
Columns
.
Single
(
c
=>
c
.
Name
==
"Name"
),
index
.
Columns
);
// Scaffolding included/covered properties is currently blocked, see #2194
var
includedColumns
=
(
string
[])
index
[
NpgsqlAnnotationNames
.
IndexInclude
]!;
if
(
TestEnvironment
.
PostgresVersion
.
AtLeast
(
11
))
{
Assert
.
Contains
(
"FirstName"
,
includedColumns
);
Assert
.
Contains
(
"LastName"
,
includedColumns
);
}
else
{
Assert
.
Null
(
includedColumns
);
}
// if (TestEnvironment.PostgresVersion.AtLeast(11))
// {
// Assert.Contains("FirstName", includedColumns);
// Assert.Contains("LastName", includedColumns);
// }
// else
// {
// Assert.Null(includedColumns);
// }
});
AssertSql
(
TestEnvironment
.
PostgresVersion
.
AtLeast
(
11
)
...
...
@@ -1987,16 +1999,20 @@ public virtual async Task Create_index_unique_with_include_and_filter()
Assert
.
Equal
(
@"(""Name"" IS NOT NULL)"
,
index
.
Filter
);
Assert
.
Equal
(
1
,
index
.
Columns
.
Count
);
Assert
.
Contains
(
table
.
Columns
.
Single
(
c
=>
c
.
Name
==
"Name"
),
index
.
Columns
);
// Scaffolding included/covered properties is currently blocked, see #2194
var
includedColumns
=
(
string
[])
index
[
NpgsqlAnnotationNames
.
IndexInclude
]!;
if
(
TestEnvironment
.
PostgresVersion
.
AtLeast
(
11
))
{
Assert
.
Contains
(
"FirstName"
,
includedColumns
);
Assert
.
Contains
(
"LastName"
,
includedColumns
);
}
else
{
Assert
.
Null
(
includedColumns
);
}
// if (TestEnvironment.PostgresVersion.AtLeast(11))
// {
// Assert.Contains("FirstName", includedColumns);
// Assert.Contains("LastName", includedColumns);
// }
// else
// {
// Assert.Null(includedColumns);
// }
});
AssertSql
(
TestEnvironment
.
PostgresVersion
.
AtLeast
(
11
)
...
...
test/EFCore.PG.FunctionalTests/Scaffolding/NpgsqlDatabaseModelFactoryTest.cs
浏览文件 @
40dc0d3c
...
...
@@ -1728,7 +1728,9 @@ public void Index_covering()
var
indexWith
=
table
.
Indexes
.
Single
(
i
=>
i
.
Name
==
"ix_with"
);
Assert
.
Equal
(
"a"
,
indexWith
.
Columns
.
Single
().
Name
);
Assert
.
Equal
(
new
[]
{
"b"
,
"c"
},
indexWith
.
FindAnnotation
(
NpgsqlAnnotationNames
.
IndexInclude
).
Value
);
// Scaffolding included/covered properties is currently blocked, see #2194
Assert
.
Null
(
indexWith
.
FindAnnotation
(
NpgsqlAnnotationNames
.
IndexInclude
));
// Assert.Equal(new[] { "b", "c" }, indexWith.FindAnnotation(NpgsqlAnnotationNames.IndexInclude).Value);
var
indexWithout
=
table
.
Indexes
.
Single
(
i
=>
i
.
Name
==
"ix_without"
);
Assert
.
Equal
(
new
[]
{
"a"
,
"b"
,
"c"
},
indexWithout
.
Columns
.
Select
(
i
=>
i
.
Name
).
ToArray
());
...
...
jobily
@jobily
mentioned in commit
bfd20dee
·
9月 18, 2023
mentioned in commit
bfd20dee
mentioned in commit bfd20dee5385b44bac9e766b725ad3092c00d972
开关提交列表
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录