-
-
Notifications
You must be signed in to change notification settings - Fork 18
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
Catalogue MANDATORY constraints not considered in DB #623
Comments
Before I knock on the ili2db door I first ask for any experience on that, since I think if it's an issue you might have encountered it already @zigertiger @romefi Maybe I just made something wrong on schema create or modelling. In case it's something ili2db cannot handle, we might want to think about a Model Baker solution. |
Is there something missing on the described use case (model or command) or is it just not supported the way it is @claeis? Are there any suggestions how to handle it? |
While ordinary one-to-many associations works like expected:
sql:
|
This might be a weakness in ili2db but as far as I understood @claeis is not that easy solvable since in other situation these fields need to be NULL. |
Ok, makes sense to me. Do you see a chance to solve that on Model Baker without the NOT NULL in the database? Or shall we leave it to:
|
I do not know whether it is the right place to add those thoughts. If not please feel free to move this to a new issue or discussion. Is there a general concept about the use of ModelBaker? Is it ...
I think depeding on what I want to do I would want MANDATORY constraints checked or not. Or set flags like --disablevalidation on or off (see https://github.com/claeis/ili2db/blob/master/docs/ili2db.rst#fehlerhafte-daten). When I look at the development of the last months there have been beeen various tasks added and you can use it for all three purposes above and even more. But it would need other default settings depending on what you want to do. |
Thanks for your inputs. There are the @sjib Yes, Model Baker can handle all of your mentioned workflows. I think, the reason to be able to import invalid data could be just to visualize them or to correct them as well. Anyway the constraints should be - as much as possible - like in the model. The case that a user wants to produce invalid data by having no constraints (maybe to be quick and fix it later on) is more a side case that can be managed by removing the constraints from the project manually. |
@sjib Model Baker should cover all these use cases. It's worth a thought to add more usecases in the wizzard and have the propper settings depending on the use case. Thanks for the input. We'll discuss it in the project steeriing group. For now the focus lays on helping people collecting new data, so all constraints should be covered if ever possible. @signedav as it's not high priority I suggest we discuss this issue at the next meeting. |
Note:
Here we have in
As well as Smart1Inheritance with SuperClass having attributes optional and subclasses are extending mandatory
Sollution maybe:t_ili2db_meta_attrs
We do have t_ili2db_trafo
|
Another situation (not making big sense in catalogues but a fair construct):
When using smart inheritance 2 it will make a super class called
and
Sollution maybe:t_ili2db_meta_attrs
We do have t_ili2db_trafo
|
Just tested with SH_Pflegeplanung_Fliessgewaesser_V1_0.zip E..g. Fauna > Objekt is a MANDATORY reference to CatalogueObject. In the formular Objekt is still optional: Unless the INTERLIS-model is wrong for the use case, it doesn't seem to work. |
I can confirm. Tested it again myself and added a comment here claeis/ili2db#475 (comment) |
When I have a model using
CatalogueObjects_V1
as catalogue base and I extend (1) theMandatoryCatalogueReference
and (2) set the attribute referencing it to MANDATORY it still creates me a table without any NOT NULL constraint on those attributes.Running this:
Creates in PostgreSQL:
t_ili2db_trafo at smart1
t_ili2db_trafo at smart2
The text was updated successfully, but these errors were encountered: