Skip to content

Fix duplicate entity checks#1287

Merged
parsonsmatt merged 6 commits intomasterfrom
matt/fix-discover-entities
Jun 18, 2021
Merged

Fix duplicate entity checks#1287
parsonsmatt merged 6 commits intomasterfrom
matt/fix-discover-entities

Conversation

@parsonsmatt
Copy link
Collaborator

@parsonsmatt parsonsmatt commented Jun 17, 2021

Before submitting your PR, check that you've:

  • Documented new APIs with Haddock markup
  • Added @since declarations to the Haddock
  • Ran stylish-haskell on any changed files.
  • Adhered to the code style (see the .editorconfig file for details)

After submitting your PR:

  • Update the Changelog.md file with a link to your PR
  • Bumped the version number if there isn't an (unreleased) on the Changelog
  • Check that CI passes (or if it fails, for reasons unrelated to your change, like CI timeouts)

Closes #1288

newEnts =
Set.toList $
Set.fromList allEnts
Set.\\ Set.fromList (map unbindEntityDef preexistingEntities)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lol, sigh, alas, oh well, so silly,,,

@parsonsmatt
Copy link
Collaborator Author

mm no this is broken still

looks like the code in the symbolToField stuff needs to do a qualified lookup

Copy link
Collaborator Author

@parsonsmatt parsonsmatt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I've got it fixed. Mostly by skipping the transformation from ModelNameId to Key ModelName if we're not in the mpsGeneric mode.

Another bug from #1204 :\

mkPersistWith sqlSettings $(discoverEntities) [persistLowerCase|

Profile
ProfileX
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

persistent now fails to generate code for Profile because Profile is already a table defined in discoverEntities.

@parsonsmatt parsonsmatt merged commit 6de3ffe into master Jun 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The duplicate entity check doesn't work transitively

1 participant