-
-
Notifications
You must be signed in to change notification settings - Fork 300
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding support for table and column renaming using Regex #496
Conversation
You must rebase on latest master |
Would it be possible to design for expetions from the general rules for individual tables and/or columns? |
Sorry, I didn't understand what you meant there. |
I just didn't read this properly: The regex renaming also have lower priority over the current renaming method, and therefore, if a table is renamed using "NewName", the NewName method will prevail over the regex. |
Please address review comments |
Great, thanks a lot for the contribution |
This is a great feature. Thanks! |
You are welcome, agree that it rounds out the renaming feature nicely. |
I'm sorry but I don't understand how to use this feature. i add
to the efpt.config.json file but it gets overwritten when i rerun the reverse engineer. |
@engineruguz No worries - You got the file name wrong - see https://github.com/ErikEJ/EFCorePowerTools/wiki/Reverse-Engineering#custom-renaming-with-efptrenamingjson |
oooh! i see. feel dumb lol |
hi! sorry. i still can't find out why it's not working? i created efpt.renaming.json file at project root like below.
i'm trying to add Entity at the end of every table. not sure about $0 is the correct syntax though but not getting anything different. |
Wrong file format... |
uh ofc! sorry. thanks |
Either I'm doing something very dumb or there's an issue with ColumnPatternReplaceWith { In this example using .net 5 (and latest version of vsix installed today) Every table is renamed properly with the TEST_TABLE_ prefix, however no column is renamed at all. Is there something I'm missing? |
@marcziss if you have an issue, please create one with detailed repro steps. |
@marcziss I struggled with the same problem. Solution: add "Table: []". That magically worked for me. |
Hello, first I'd like to thank you for this tool, it has been very useful and I am more than happy to contribute.
I had the need to remove some prefixes from my tables. I found out this thread but didn't want to map my entire database.
So I took inspiration from there and included 4 new properties in the Schema object. These will receive the pattern to be matched and a string to replace tables and columns names.
TableRegexPattern: pattern to be matched by table names
TablePatternReplaceWith: string that will replace the occurrences of the pattern in tables names
ColumnRegexPattern: pattern to be matched by column names
ColumnPatternReplaceWith: string that will replace the occurrences of the pattern in columns names
The regex renaming also have lower priority over the current renaming method, and therefore, if a table is renamed using "NewName", the NewName method will prevail over the regex
Example of use:
efpt.renaming.json