Skip to content
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

Fix duplicate entity checks #1287

Merged
merged 6 commits into from
Jun 18, 2021
Merged

Fix duplicate entity checks #1287

merged 6 commits into from
Jun 18, 2021

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 :\

@@ -28,7 +28,7 @@ import Database.Persist.TH.SharedPrimaryKeySpec (User, UserId)

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