claeis / ili2db

interlis import/export to relational databases
30 stars 30 forks source link

Schema import fails in versions later than 4.6.1 when a topic extends to another one. #492

Closed yesidpol closed 2 years ago

yesidpol commented 2 years ago

Schema import fails in versions later than 4.6.1 with this error:

Model ModelA requires column T_basket

But when the version is 4.6.1 or earlier, the process is successful. Both models were compiled correctly. I checked this behaviour in ili2gpkg and ili2pg.

The arguments that I used:

--coalesceCatalogueRef --coalesceMultiLine --smart2Inheritance --createUnique --beautifyEnumDispName --createFkIdx --schemaimport --createFk --createEnumTabsWithId --defaultSrsCode 3116 --coalesceMultiSurface --createNumChecks --strokeArcs --createGeomIdx --createMetaInfo

and the models:

INTERLIS 2.3;

MODEL ModelA (de) AT "http://www.google.com" VERSION "2022_10_25" = 
    IMPORTS ModelB;

    TOPIC MainTopic EXTENDS ModelB.BaseTopic = 
        CLASS MyClass = 
            description: MTEXT*30;
        END MyClass;
    END MainTopic;
END ModelA.
INTERLIS 2.3;

MODEL ModelB (de) AT "http://www.google.com" VERSION "2022_10_25" = 
    TOPIC BaseTopic = 

    END BaseTopic;
END ModelB.
claeis commented 2 years ago

That's intended to prevent unexpected exports. (see also #130)