-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: create separate kaps seed migration file (#243)
- Loading branch information
1 parent
b32415c
commit d1c88c2
Showing
2 changed files
with
24 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
apps/api/src/database/migrations/1692870736647-kapsseeddata.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { MigrationInterface, QueryRunner } from 'typeorm'; | ||
|
||
export class KapsSeedData1692870736647 implements MigrationInterface { | ||
name = 'KapsSeedData1692870736647'; | ||
|
||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query( | ||
`INSERT INTO notify_master_providers (name,provider_type,configuration) VALUES (?, ?, ?)`, | ||
[ | ||
'SMS_KAPSYSTEM', | ||
2, | ||
'{"KAP_SMS_BASE_API_URL": {"lable": "KAP SMS BASE API URL","id": "KAP_SMS_BASE_API_URL","pattern": "^https?://[^(\\?\\s)]+$","type": "string"},"KAP_SMS_ACCOUNT_USERNAME": {"lable": "KAP SMS ACCOUNT USERNAME","id": "KAP_SMS_ACCOUNT_USERNAME","pattern": "^[a-zA-Z0-9_-]{3,30}$","type": "string"},"KAP_SMS_ACCOUNT_PASSWORD": {"lable": "KAP_SMS_ACCOUNT_PASSWORD","id": "KAP SMS ACCOUNT PASSWORD","pattern": "^[a-zA-Z0-9_-]{3,30}$","type": "string"},"KAP_SMS_FROM": {"lable": "KAP SMS FROM","id": "KAP_SMS_FROM","pattern": "^[a-zA-Z]{6}$","type": "string"}}', | ||
], | ||
); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(` | ||
DELETE FROM notify_master_providers | ||
WHERE master_id = 8; | ||
`); | ||
} | ||
} |