Some entities in my database have a property which is their associated key on AWS S3, for example:
// my.entity.ts
@Column()
s3Key: string;
I would like one of TypeOrm's entity listeners, @AfterRemove or @BeforeRemove to execute their functions when the table is dropped using the TypeOrm cli? This kind of action would be really helpful when developing locally so I don't have to delete S3 objects one by one when dropping the db
// my.entity.ts
@AfterRemove()
async deleteFromS3AfterRemove() {
await deleteFromS3("BUCKET_NAME", this.s3Key);
}
So, will these entity listeners still be executed when the table is dropped or does anyone know if typeorm schema:drop emits the remove subscription events?
I had a look around at the source and docs but couldn't find anything https://github.com/typeorm/typeorm/blob/master/src/commands/SchemaDropCommand.ts