+ // Add foreign keys information for children (inheritance). TODO: allow several levels
+ // NOTE: modelisation assume each child has its own table, refering parent (other options exist)
+ this.inheritances.forEach( inh => {
+ let idx = this.tables[inh.parent].findIndex( item => { return item.isKey; });
+ inh.children.forEach( c => {
+ this.tables[c].push({
+ name: inh.parent + "_id",
+ type: this.tables[inh.parent][idx].type,
+ isKey: true,
+ qualifiers: this.tables[inh.parent][idx].qualifiers || "",
+ ref: inh.parent + "(" + this.tables[inh.parent][idx].name + ")",
+ });
+ });
+ });