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

Proposal Unique (PhysObj.code, PhysObj.type) Constraint defined per PhysObj.Type #49

Open
petrus-v opened this issue Jul 23, 2021 · 0 comments

Comments

@petrus-v
Copy link

petrus-v commented Jul 23, 2021

Hi there !

I'd like to propose a new constraint to ensure phyobj.code are unique for given physobj.type.

The idea would be to add a boolean field ensure_unique on PhysObj.Type to make it configurable. As I would suggest that AWB-core do not assume how PhysObj.code are used by developer, probably some developer use PhysObj.code field to collect lot number which require to allow duplicated code for this given PhysObj.Type

note: I've checked that PhysObj.code is nullable and (posgre)SQL consider Null as different value in this kind of unique constraint so even the ensure_unique is true that would let developers to unpack PhysObj with null value in a first step and assign the code afterwards in his workflow.

Does this is useful to share ? Can I create a PR to improve AWB-core directly or should I create a dedicated blok somewhere else ?

Regards,

@petrus-v petrus-v changed the title Proposal Unique (physob.code, pysobj.type) Constraint defined per phyobj.Type Proposal Unique (PhysObj.code, PhysObj.type) Constraint defined per PhysObj.Type Jul 23, 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

No branches or pull requests

1 participant