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