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

Add keyAndEntityFieldsDatabase function to return key with migration only fields #1519

Merged

Conversation

josephsumabat
Copy link
Contributor

@josephsumabat josephsumabat commented Sep 30, 2023

This PR adds a version of the keyAndEntityFields function which includes MigrationOnly and SafeToRemove fields. We would like to make use of this in persistent-documentation in order to generate documentation for fields marked by those modifiers.

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)

@josephsumabat josephsumabat changed the title Add keyAndEntityFieldsDatabase function to return key with migration only felds Add keyAndEntityFieldsDatabase function to return key with migration only fields Sep 30, 2023
@josephsumabat josephsumabat force-pushed the joseph/add-key-and-entity-fields-db branch from 9976570 to 9865a29 Compare September 30, 2023 12:09
Copy link
Collaborator

@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.

Thanks, looks great! Do you mind adding a Changelog entry? I haven't released 2.14.6.0 yet so we can fold this in there.

Comment on lines +223 to +224
keyWithFields :: EntityIdDef -> [FieldDef] -> NonEmpty FieldDef
keyWithFields entId fields =
Copy link
Collaborator

Choose a reason for hiding this comment

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

This exported too, mind adding a doc comment and @since?

persistent/Database/Persist/Types/Base.hs Outdated Show resolved Hide resolved
@parsonsmatt parsonsmatt added this to the 2.14.6 milestone Oct 3, 2023
@parsonsmatt parsonsmatt merged commit 38654d9 into yesodweb:master Oct 3, 2023
7 checks passed
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.

None yet

2 participants