atviriduomenys / spinta

Spinta is a framework to describe, extract and publish data (a DEP Framework).
MIT License
10 stars 4 forks source link

Fix backref expression in property column #664

Open sirex opened 1 week ago

sirex commented 1 week ago

In #161 task description an incorrect examples where given for array type usage with ref. The correct expression should look like this (correct, fixed example):

d | r | b | m | property    | type    | ref
example                     |         |
                            |         |
  |   |   | Language        |         |
  |   |   |   | name@en     | text    |
  |   |   |   | countries[] | backref | Country
                            |         |
  |   |   | Country         |         |
  |   |   |   | name@en     | text    |
  |   |   |   | languages   | array   | CountryLanguage[country, language]
  |   |   |   | languages[] | ref     | Language
                            |         |
  |   |   | CountryLanguage |         |
  |   |   |   | country     | ref     | Country
  |   |   |   | language    | ref     | Language

When using many-to-many relations, we must know order of references in order to correctly associate intermediate table.

Currently, following error is raised:

DataTypeCannotBeUsedForNesting: Type 'array_backref' cannot be used for nesting properties.

Related