enhance: update migration to work with newer model schema
This commit is contained in:
parent
c35b99e0c4
commit
72552bdd83
1 changed files with 3 additions and 3 deletions
|
@ -10,8 +10,8 @@ export class QueryToUUID1742922178643 implements MigrationInterface {
|
|||
const foreignKey = table.foreignKeys.find((fk) => fk.columnNames.indexOf("recipientsByQueryId") !== -1);
|
||||
await queryRunner.dropForeignKey("newsletter", foreignKey);
|
||||
|
||||
const entries = await queryRunner.manager.getRepository(query).find({ select: { title: true, query: true } });
|
||||
await queryRunner.clearTable("query");
|
||||
// const entries = await queryRunner.manager.getRepository("query").find({ select: { title: true, query: true } });
|
||||
// await queryRunner.clearTable("query");
|
||||
|
||||
await queryRunner.dropColumn("newsletter", "recipientsByQueryId");
|
||||
await queryRunner.dropColumn("query", "id");
|
||||
|
@ -32,7 +32,7 @@ export class QueryToUUID1742922178643 implements MigrationInterface {
|
|||
})
|
||||
);
|
||||
|
||||
await queryRunner.manager.createQueryBuilder().insert().into("query").values(entries).execute();
|
||||
// await queryRunner.manager.getRepository("query").save(entries);
|
||||
|
||||
await queryRunner.createForeignKey(
|
||||
"newsletter",
|
||||
|
|
Loading…
Add table
Reference in a new issue