generators/fix-entity/prompts.js
function askForRelationshipsId() {
    // Don't ask relationship id if there aren't any relationship
    // Or option --force
    if (this.relationships === undefined || this.relationships.length === 0 || this.force) {
        return;
    }

    // work only on owner relationship
    this.relationshipsPile = this.relationships.filter(relationshipItem =>
        // We don't need to do anything about relationships which don't add any constraint.
        !(relationshipItem.relationshipType === 'one-to-many' ||
            (relationshipItem.relationshipType === 'one-to-one' && !relationshipItem.ownerSide) ||
            (relationshipItem.relationshipType === 'many-to-many' && !relationshipItem.ownerSide)));

    if (this.relationshipsPile.length === 0) {
        return;
    }

    this.log(chalk.green(`Asking column names for ${this.relationshipsPile.length} relationship(s)`));
    const done = this.async();

    this.relationship = this.relationshipsPile.shift();
    askForRelationshipId.call(this, done);
}
function askForRelationshipsId() {
    // Don't ask relationship id if there aren't any relationship
    // Or option --force
    if (this.relationships === undefined || this.relationships.length === 0 || this.force) {
        return;
    }

    // work only on owner relationship
    this.relationshipsPile = this.relationships.filter(relationshipItem =>
        // We don't need to do anything about relationships which don't add any constraint.
        !(relationshipItem.relationshipType === 'one-to-many' ||
            (relationshipItem.relationshipType === 'one-to-one' && !relationshipItem.ownerSide) ||
            (relationshipItem.relationshipType === 'many-to-many' && !relationshipItem.ownerSide)));

    if (this.relationshipsPile.length === 0) {
        return;
    }

    this.log(chalk.green(`Asking column names for ${this.relationshipsPile.length} relationship(s)`));
    const done = this.async();

    this.relationship = this.relationshipsPile.shift();
    askForRelationshipId.call(this, done);
}
function askForRelationshipsId ( ) { // Don't ask relationship id if there aren't any relationship // Or option --force if ( this . relationships === undefined || this . relationships . length === 0 || this . force ) { return ; } // work only on owner relationship this . relationshipsPile = this . relationships . filter ( relationshipItem => // We don't need to do anything about relationships which don't add any constraint. ! ( relationshipItem . relationshipType === 'one-to-many' || ( relationshipItem . relationshipType === 'one-to-one' && ! relationshipItem . ownerSide ) || ( relationshipItem . relationshipType === 'many-to-many' && ! relationshipItem . ownerSide ) ) ) ; if ( this . relationshipsPile . length === 0 ) { return ; } this . log ( chalk . green ( ` ${ this . relationshipsPile . length } ` ) ) ; const done = this . async ( ) ; this . relationship = this . relationshipsPile . shift ( ) ; askForRelationshipId . call ( this , done ) ; }
For each relationship of entity, ask for actual column name
For each relationship of entity ask for actual column name