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

PK regex is outdated in E2 rule #106

Closed
TahaBelKhayate opened this issue Oct 4, 2022 · 2 comments
Closed

PK regex is outdated in E2 rule #106

TahaBelKhayate opened this issue Oct 4, 2022 · 2 comments

Comments

@TahaBelKhayate
Copy link

TahaBelKhayate commented Oct 4, 2022

The E2 rule's regex used to check whether a field is a PK seems outdated:
const pkRegex = /^([0-9]+pk|pk[0-9]+)_([a-z0-9A-Z_]+)$/;

This forces all fields in sql_on to have a number following or preceding pk. But as I understand, an update made possible to use pk_xxx directly when the number of fields used for the PK is exactly 1.

The correct regex should then probably be the same as for rule K1-2-3-4:
const pkRegex = /^([0-9]+pk|pk[0-9]*)_([a-z0-9A-Z_]+)$/

I would gladly contribute to the project for others bugs I found, do not hesitate to contact me if needed: taha.belkhayate@jellysmack.com

@fabio-looker
Copy link
Contributor

Thank you! I should be able to release an update for this in a day or two

@fabio-looker
Copy link
Contributor

Fixed in v2.1.5

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

No branches or pull requests

2 participants