summaryrefslogtreecommitdiff
path: root/src/models/entities/messaging-message.ts
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2019-05-18 20:36:33 +0900
committersyuilo <syuilotan@yahoo.co.jp>2019-05-18 20:36:33 +0900
commitc7cc3dcdfd2c0962a39e7186852a17dbd09b6a5b (patch)
treec2e1671787c00daa8963c879dba6fbdab6f02d66 /src/models/entities/messaging-message.ts
parentFix bug (diff)
downloadsharkey-c7cc3dcdfd2c0962a39e7186852a17dbd09b6a5b.tar.gz
sharkey-c7cc3dcdfd2c0962a39e7186852a17dbd09b6a5b.tar.bz2
sharkey-c7cc3dcdfd2c0962a39e7186852a17dbd09b6a5b.zip
ユーザーグループ
Resolve #3218
Diffstat (limited to 'src/models/entities/messaging-message.ts')
-rw-r--r--src/models/entities/messaging-message.ts24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/models/entities/messaging-message.ts b/src/models/entities/messaging-message.ts
index d3c3eab3a2..c18897a37d 100644
--- a/src/models/entities/messaging-message.ts
+++ b/src/models/entities/messaging-message.ts
@@ -2,6 +2,7 @@ import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typ
import { User } from './user';
import { DriveFile } from './drive-file';
import { id } from '../id';
+import { UserGroup } from './user-group';
@Entity()
export class MessagingMessage {
@@ -29,10 +30,10 @@ export class MessagingMessage {
@Index()
@Column({
- ...id(),
+ ...id(), nullable: true,
comment: 'The recipient user ID.'
})
- public recipientId: User['id'];
+ public recipientId: User['id'] | null;
@ManyToOne(type => User, {
onDelete: 'CASCADE'
@@ -40,6 +41,19 @@ export class MessagingMessage {
@JoinColumn()
public recipient: User | null;
+ @Index()
+ @Column({
+ ...id(), nullable: true,
+ comment: 'The recipient group ID.'
+ })
+ public groupId: UserGroup['id'] | null;
+
+ @ManyToOne(type => UserGroup, {
+ onDelete: 'CASCADE'
+ })
+ @JoinColumn()
+ public group: UserGroup | null;
+
@Column('varchar', {
length: 4096, nullable: true
})
@@ -52,6 +66,12 @@ export class MessagingMessage {
@Column({
...id(),
+ array: true, default: '{}'
+ })
+ public reads: User['id'][];
+
+ @Column({
+ ...id(),
nullable: true,
})
public fileId: DriveFile['id'] | null;