add creationDate to Document

This commit is contained in:
2019-01-20 19:37:19 +03:00
parent c7e7b956c1
commit 3b2d49a0d4

View File

@@ -22,8 +22,12 @@ export class Document extends BaseEntity {
@Column({ type: "text" })
public content: string;
@Column({ type: "timestamp" })
public createdAt: Date;
constructor(user: User, name: string, content: string) {
super();
this.createdAt = new Date();
this.user = user;
this.name = name;
this.content = content;