efcore icon indicating copy to clipboard operation
efcore copied to clipboard

Use precision/scale facets instead of store type when reverse engineering

Open RoderickIveans opened this issue 2 years ago • 1 comments

Fixes https://github.com/dotnet/efcore/issues/29711

  • [x] I've read the guidelines for contributing and seen the walkthrough
  • [x] I've posted a comment on an issue with a detailed description of how I am planning to contribute and got approval from a member of the team
  • [x] The code builds and tests pass locally (also verified by our automated build checks)
  • [x] Commit messages follow this format:
        Summary of the changes
        - Detail 1
        - Detail 2

        Fixes #bugnumber
  • [ ] Tests for the changes have been added (for bug fixes / features)
  • [x] Code follows the same patterns and style as existing code in this repo

RoderickIveans avatar Jan 13 '23 07:01 RoderickIveans

CLA assistant check
All CLA requirements met.

dnfadmin avatar Jan 13 '23 07:01 dnfadmin

@roji Can you review and give me some suggestions?

RoderickIveans avatar Jan 28 '23 04:01 RoderickIveans

It seems to only introduce a space in the store type representation between precision and scale?

@roji Yes, it is because this space causes them to be different

https://github.com/dotnet/efcore/blob/81886272a761df8fafe4970b895b1e1fe35effb8/src/EFCore.Design/Scaffolding/Internal/ScaffoldingTypeMapper.cs#L66

RoderickIveans avatar Jan 28 '23 07:01 RoderickIveans

Yes, it is because this space causes them to be different

I don't understand - different from what? #29711 is about something quite different...

roji avatar Jan 28 '23 07:01 roji

Can you tell me a unit test example of reverse engineering? I do a unit test to explain what I do

RoderickIveans avatar Jan 28 '23 07:01 RoderickIveans

You can take a look at SqlServerDatabaseModelFactoryTest. For example, the Decimal_numeric_types_have_precision_scale test scaffolds numeric columns with various precision/scale combinations (but please keep this comment in mind).

roji avatar Jan 28 '23 08:01 roji

@roji I've added unit test

RoderickIveans avatar Jan 29 '23 04:01 RoderickIveans

@RoderickIveans We appreciate the effort here, but it doesn't seem like what you are implementing is what is described in issue #29711. Perhaps you could describe in your own words what you are trying to do here and then maybe we can find the disconnect?

ajcvickers avatar Feb 03 '23 17:02 ajcvickers