Skip to content

Conversation

@bajtos
Copy link
Member

@bajtos bajtos commented Nov 11, 2019

Refactor ast-helper used by lb4 relation to allow addition of more patterns for detecting id property definitions.

Add support for PK properties defined as {id: 1}, in addition to already supported flavor {id: true}.

Context

When importing models from LB3, or discovering them from a database, we set id flag to a number - a position of the property in a multi-property index. This works fine at runtime, but was not supported by our CLI, as I discovered while writing migration guide for model relations (see #4058 and #3948).

Checklist

👉 Read and sign the CLA (Contributor License Agreement) 👈

  • npm test passes on your machine
  • New tests added or existing tests modified to cover all changes
  • Code conforms with the style guide
  • API Documentation in code was updated
  • Documentation in /docs/site was updated
  • Affected artifact templates in packages/cli were updated
  • Affected example projects in examples/* were updated

👉 Check out how to submit a PR 👈

@bajtos bajtos added this to the Nov 2019 milestone milestone Nov 11, 2019
@bajtos bajtos self-assigned this Nov 11, 2019
@bajtos bajtos changed the title feat(cli): support PK properties defined as {id: 1} feat(cli): recognize PK properties defined as {id: 1} Nov 11, 2019
@bajtos bajtos force-pushed the fix/cli-relation-with-numeric-id-flag branch from a7a5655 to 155ff36 Compare November 11, 2019 09:05
@bajtos bajtos mentioned this pull request Nov 11, 2019
3 tasks
@bajtos bajtos requested a review from a team November 11, 2019 12:52
Refactor `ast-helper` used by `lb4 relation` to allow addition of
more patterns for detecting id property definitions.

Add support for PK properties defined as `{id: 1}`, in addition
to already supported flavor `{id: true}`.

Signed-off-by: Miroslav Bajtoš <mbajtoss@gmail.com>
@bajtos bajtos force-pushed the fix/cli-relation-with-numeric-id-flag branch from 1c4856b to e91230b Compare November 12, 2019 08:04
@bajtos bajtos merged commit 1094509 into master Nov 12, 2019
@bajtos bajtos deleted the fix/cli-relation-with-numeric-id-flag branch November 12, 2019 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants