msawczyn / EFDesigner2022

Entity Framework visual design surface and code-first code generation for EF6, Core and beyond
MIT License
119 stars 21 forks source link

Feature request: enable or disable an entity property #74

Closed mamift closed 10 months ago

mamift commented 10 months ago

I have a model with a large entity with many properties (about 155+):

image

It would be good to have a feature that allows one to disable or enable an individual property such that:

BlackPuddingERP commented 10 months ago

Hello @mamift,

I've been thinking for a while about your proposal, and I don't see in which cases it could be useful when designing the database. In what cases would this functionality be useful? Wouldn't it work to set the Persistent property to false in the field's properties to make it not exist in the database?

Regards

mamift commented 10 months ago

Ah I did not know about that, and that comes close, as changing Persistent to false does get picked up by EF migrations, so I'll use that for now.

I have a library where clients are constantly changing (an in-production app) which columns are in use and which aren't; there are about 150+ in use columns, but about 500+ that aren't. So in total the column count is about ~650.

I realise I can't just leave them sitting there unused (in the database) as I'm getting awfully close to the 1024 column table limit in SQL Server, so I need to remove columns from the table to stay under that limit, and there's seemingly no end in sight as to all the extra columns they might want. They also change their minds about some columns, so ones they thought they didn't need, they realise they want them back.

mamift commented 10 months ago

This solves my issue. Thanks.