Created
March 20, 2018 16:26
-
-
Save rkkautsar/45175ff9685fdc88317f109c36a1f7e3 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import { Entity, Column, ManyToOne, OneToMany } from 'typeorm'; | |
import { BaseEntity } from './BaseEntity'; | |
import { Project } from './Project'; | |
import { Task } from './Task'; | |
@Entity() | |
export class List extends BaseEntity { | |
@Column('varchar') name!: string; | |
@ManyToOne(type => Project, project => project.lists) | |
project!: Project; | |
@OneToMany(type => Task, task => task.list) | |
tasks!: Task[]; | |
} |
This file contains hidden or 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
import { Entity, Column, ManyToOne, OneToMany } from 'typeorm'; | |
import { BaseEntity } from './BaseEntity'; | |
import { List } from './List'; | |
import { TaskMutation } from './TaskMutation'; | |
@Entity() | |
export class Task extends BaseEntity { | |
@Column('varchar') title!: string; | |
@Column('varchar', { nullable: true }) | |
assignee!: string; | |
@ManyToOne(type => List, list => list.tasks) | |
list!: List; | |
@OneToMany(type => TaskMutation, mutation => mutation.task) | |
mutations!: TaskMutation[]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment