sms templated module

This commit is contained in:
2026-06-30 11:07:23 +03:30
parent d5448ba07a
commit 3420de0011
10 changed files with 329 additions and 0 deletions
@@ -0,0 +1,45 @@
import {
MigrationInterface,
QueryRunner,
Table,
TableIndex,
} from 'typeorm';
export class AddSmsTemplates1720100000000 implements MigrationInterface {
name = 'AddSmsTemplates1720100000000';
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.createTable(
new Table({
name: 'sms_templates',
columns: [
{
name: 'id',
type: 'uuid',
isPrimary: true,
generationStrategy: 'uuid',
default: 'gen_random_uuid()',
},
{ name: 'title', type: 'varchar', length: '200' },
{ name: 'body', type: 'text' },
{ name: 'isActive', type: 'boolean', default: true },
{ name: 'createdAt', type: 'timestamp', default: 'now()' },
{ name: 'updatedAt', type: 'timestamp', default: 'now()' },
],
}),
true,
);
await queryRunner.createIndex(
'sms_templates',
new TableIndex({
name: 'IDX_sms_templates_isActive',
columnNames: ['isActive'],
}),
);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.dropTable('sms_templates', true);
}
}