Improve migration script
This commit is contained in:
parent
7bf1c764aa
commit
51a32c7617
@ -19,13 +19,10 @@ export class MigratorController {
|
||||
|
||||
@Get()
|
||||
async migrate() {
|
||||
const registers = await this.registroGIERepository.find({
|
||||
// @ts-ignore
|
||||
select: {
|
||||
cursoGIE: null,
|
||||
persona: null,
|
||||
},
|
||||
});
|
||||
const registers = await this.registroGIERepository.createQueryBuilder("register")
|
||||
.where("cursoGIEId IS NULL")
|
||||
.andWhere("personaId IS NULL")
|
||||
.getMany();
|
||||
|
||||
// Try to create Persons for each user
|
||||
for (const register of registers) {
|
||||
@ -138,7 +135,6 @@ export class MigratorController {
|
||||
</body>
|
||||
</html>
|
||||
`;
|
||||
return `NOT FOUND IN DB NOR SUNAT: ${JSON.stringify(register)}`;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user