ToolJet/server/migrations/1656312830147-CreateCommentUsers.ts
Gandharv b5850a4694
feat: trigger mail when user is mentioned in comment (#3443)
* feat: trigger mail when user is mentioned in comment

* reset email service

* fix backspace issue

* open comment on view comment clicked from email

* add helper to highlight user in mail

* reset mentioned input value when value turns empty in parent

* fix test

* use where condition + throw error

* add userId

* feat: add notification center (#3484)

* remove commented code
2022-07-25 11:14:59 +05:30

63 lines
1.6 KiB
TypeScript

import { MigrationInterface, QueryRunner, Table } from 'typeorm';
export class CreateCommentUsers1656312830147 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.createTable(
new Table({
name: 'comment_users',
columns: [
{
name: 'id',
type: 'uuid',
isGenerated: true,
default: 'gen_random_uuid()',
isPrimary: true,
},
{
name: 'comment_id',
type: 'uuid',
isNullable: false,
},
{
name: 'user_id',
type: 'uuid',
isNullable: false,
},
{
name: 'is_read',
type: 'boolean',
default: false,
isNullable: true,
},
{
name: 'created_at',
type: 'timestamp',
isNullable: true,
default: 'now()',
},
{
name: 'updated_at',
type: 'timestamp',
isNullable: true,
default: 'now()',
},
],
foreignKeys: [
{
referencedTableName: 'users',
referencedColumnNames: ['id'],
columnNames: ['user_id'],
},
{
referencedTableName: 'comments',
referencedColumnNames: ['id'],
columnNames: ['comment_id'],
},
],
}),
true
);
}
public async down(queryRunner: QueryRunner): Promise<void> {}
}