Drone.ts 562 Bytes
import {
  Entity,
  CreateDateColumn,
  PrimaryGeneratedColumn,
  Column,
  ManyToMany,
  ManyToOne,
  EntityOptions,
  OneToMany,
  OneToOne
} from "typeorm";

import User from "./User";
import Model from "./Model";
import Dataset from "./Dataset";

@Entity("drones")
export default class Drone {
  @PrimaryGeneratedColumn() id: string;
  @Column() date: string;
  @Column() name: string;

  @ManyToOne(type => User)
  owner: User;

  @ManyToOne(type => Model)
  model: Model;

  @OneToMany(type => Dataset, dataset => dataset.producer)
  datasets: Dataset;
}