efpt.renaming.json skipping and removing a table on scaffolding
See original GitHub issueProvide steps to reproduce a bug
This is mostly a question/maybe bug report.
I have an efpt.renaming.json
definition with an entry that looks like so.
[
{
"SchemaName": "Retail",
"Tables": [
{
"Columns": [ ],
"Name": "POSSystemType",
"NewName": "POSSystemType"
}
],
"UseSchemaName": false
}
]
This scaffolds fine when it is alone. However, when I add the other tables from that schema (as I’m trying to preserve frequent POS
and SKU
usage), then this entry specifically gets skipped and removed after the scaffold run with the UI tool. The other tables are scaffolded as expected. There is also a table entry after this one which also gets scaffolded as expected.
I tried pairing down the renaming file to just two entries like so.
[
{
"SchemaName": "Retail",
"Tables": [
{
"Columns": [
{
"Name": "POSSystemId",
"NewName": "POSSystemId"
},
{
"Name": "SKU",
"NewName": "SKU"
}
],
"Name": "ItemSKU",
"NewName": "ItemSKU"
},
{
"Columns": [
],
"Name": "POSSystemType",
"NewName": "POSSystemType"
}
],
"UseSchemaName": false
}
]
Upon running again the POSSystemType
table entry is removed. The ItemSKU
table entry remains. It seems like the moment another entry is in the list POSSystemType
gets ignored/removed. Going again back to just that entry as the only one and running the tool again produces expected output and POSSystemType
is still there.
I saw mention of doing renamings with the UI tool, but I haven’t seen a way to do that. I was thinking maybe if I define these in the UI as I’ve seen hinted at then I could do a diff and see if there’s a mismatch. Would you be so kind as to point out where/how that’s done?
I generated my renamings file programmatically with some custom code and did the JSON generation with a standard JsonSerializer.Serialize
so it’s valid json. Over the course of my experiments I also re-validated the json as well.
Provide technical details
-
EF Core Power Tools version: 2.5.1544
-
Exact Visual Studio version: 2022 17.7.0
-
Database engine: SQL Server
-
EF Core version in use: 7
-
Is Handlebars templates used: seen with either
-
Is T4 templates used: seen with either
-
Is a SQL Server .dacpac used: no
Here is my redacted config.
{
"CodeGenerationMode": 3,
"ContextClassName": "[context name]",
"ContextNamespace": null,
"DefaultDacpacSchema": null,
"FilterSchemas": false,
"IncludeConnectionString": false,
"ModelNamespace": null,
"OutputContextPath": null,
"OutputPath": "Scaffold",
"PreserveCasingWithRegex": true,
"ProjectRootNamespace": "[project root]",
"Schemas": null,
"SelectedHandlebarsLanguage": 0,
"SelectedToBeGenerated": 0,
"T4TemplatePath": null,
"Tables": [...big list of tables...],
"UiHint": "[connection name]",
"UncountableWords": null,
"UseBoolPropertiesWithoutDefaultSql": false,
"UseDatabaseNames": false,
"UseDateOnlyTimeOnly": true,
"UseDbContextSplitting": true,
"UseFluentApiOnly": false,
"UseHandleBars": false,
"UseHierarchyId": false,
"UseInflector": false,
"UseLegacyPluralizer": false,
"UseManyToManyEntity": true,
"UseNoDefaultConstructor": true,
"UseNoObjectFilter": false,
"UseNodaTime": false,
"UseNullableReferences": true,
"UseSchemaFolders": true,
"UseSchemaNamespaces": true,
"UseSpatial": false,
"UseT4": false
}
Issue Analytics
- State:
- Created a month ago
- Comments:11 (7 by maintainers)
Top GitHub Comments
I implemented a fix for this in the latest daily build, would be grateful if you could try it out.
Thanks for finally sharing enough information for a proper repro! I will have a look tomorrow