feat(notification): Handle long running transaction and add status support (#8900)
RESOLVES FRMW-2110 RESOLVES FRMW-2095 **What** - Fix notification module to not retain transactions open while sending notification - Add support for notification status [success, pending, failure]
This commit is contained in:
@@ -212,6 +212,21 @@
|
||||
"nullable": true,
|
||||
"mappedType": "text"
|
||||
},
|
||||
"status": {
|
||||
"name": "status",
|
||||
"type": "text",
|
||||
"unsigned": false,
|
||||
"autoincrement": false,
|
||||
"primary": false,
|
||||
"nullable": false,
|
||||
"default": "'pending'",
|
||||
"enumItems": [
|
||||
"pending",
|
||||
"success",
|
||||
"failure"
|
||||
],
|
||||
"mappedType": "enum"
|
||||
},
|
||||
"provider_id": {
|
||||
"name": "provider_id",
|
||||
"type": "text",
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
import { Migration } from '@mikro-orm/migrations';
|
||||
|
||||
export class Migration20240830094712 extends Migration {
|
||||
|
||||
async up(): Promise<void> {
|
||||
this.addSql('alter table if exists "notification" add column if not exists "status" text check ("status" in (\'pending\', \'success\', \'failure\')) not null default \'pending\';');
|
||||
}
|
||||
|
||||
async down(): Promise<void> {
|
||||
this.addSql('alter table if exists "notification" drop column if exists "status";');
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user