0

Alguien ha visto este error? me aparece al tratar de correr una migración en mi backend con este query de typeorm, anexo el código y el error

const seeds = ['serviceSchedules']

export class deleteDuplicatedServiceSchedules1664412761472 implements

MigrationInterface { name: 'deleteDuplicatedServiceSchedules1664412761472' public async up(queryRunner: QueryRunner): Promise { for (const seed of seeds) { await this.loadCSV(seed, queryRunner) } }

public async down(queryRunner: QueryRunner): Promise<void> {
    // Do nothing
}

private async loadCSV(entity: string, queryRunner: QueryRunner) {
    const rowsToInsert = []
    const readStream = fs.createReadStream(path.join(__dirname, '/1664412761472/', `${entity}.csv`)).pipe(csv())
    for await (const row of readStream) {
        Object.keys(row).forEach((key) => {
            if ((row as any)[key] === '') (row as any)[key] = null
        })
        await getConnection()
            .createQueryBuilder()
            .delete()
            .from('servicesSchedules')
            .where('idServiceSchedule=:idServiceSchedule', {
                idServiceSchedule: row.idServiceSchedule
            })
            .execute()
    }
}

}

El error: introducir la descripción de la imagen aquí

0

Tu Respuesta

By clicking “Publica tu respuesta”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Examina otras preguntas con la etiqueta o formula tu propia pregunta.