File

src/entity/file-descriptor.entity.ts

Index

Properties

Properties

connected
Type : Boolean | null
Decorators :
@Column({default: false})
created
Type : Date
Decorators :
@CreateDateColumn()
fileCourse
Type : FilesCourse
Decorators :
@OneToMany(undefined, undefined, {onDelete: 'CASCADE', onUpdate: 'CASCADE', cascade: true})
fileName
Type : string | null
Decorators :
@Column({nullable: true, length: 255})
fileSavedName
Type : string | null
Decorators :
@Column({nullable: true, length: 255})
fileSavedURL
Type : string | null
Decorators :
@Column({nullable: true, length: 255})
fileType
Type : FileType
Decorators :
@ManyToOne(undefined, undefined, {onDelete: 'CASCADE', onUpdate: 'CASCADE', cascade: true})
fileTypeId
Type : number
Decorators :
@Column({unsigned: true})
global
Type : Boolean | null
Decorators :
@Column({default: true})
id
Type : number
Decorators :
@PrimaryGeneratedColumn({unsigned: true})
modified
Type : Date
Decorators :
@UpdateDateColumn()
tag
Type : string | null
Decorators :
@Column({nullable: true, length: 20})
import {
  Column,
  CreateDateColumn,
  Entity,
  ManyToOne,
  OneToMany,
  PrimaryGeneratedColumn,
  UpdateDateColumn,
} from "typeorm";
import { Course } from "./course.entity";
import { FilesCourse } from "./file-course.entity";
import { FileType } from "./file-type.entity";
import { User } from "./user.entity";

@Entity()
export class Files {
  @PrimaryGeneratedColumn({
    unsigned: true,
  })
  id: number;

  @Column({
    nullable: true,
    length: 255,
  })
  fileName: string | null;

  @Column({
    nullable: true,
    length: 255,
  })
  fileSavedName: string | null;

  @Column({
    nullable: true,
    length: 255,
  })
  fileSavedURL: string | null;

  @Column({
    nullable: true,
    length: 20,
  })
  tag: string | null;

  @Column({
    default: true,
  })
  global: Boolean | null;

  @Column({
    default: false,
  })
  connected: Boolean | null;

  @CreateDateColumn()
  created: Date;

  @UpdateDateColumn()
  modified: Date;

  //   @ManyToOne(
  //     (type) => Course,
  //     (course) => course.files,
  //     { onDelete: "CASCADE", onUpdate: "CASCADE", cascade: true }
  //   )
  //   course: Course;

  @OneToMany(
    (type) => FilesCourse,
    (fileCourse) => fileCourse.file,
    { onDelete: "CASCADE", onUpdate: "CASCADE", cascade: true }
  )
  fileCourse: FilesCourse;

  @ManyToOne(
    (type) => FileType,
    (fileType) => fileType.files,
    { onDelete: "CASCADE", onUpdate: "CASCADE", cascade: true }
  )
  fileType: FileType;
  @Column({
    unsigned: true,
  })
  fileTypeId: number;
}

result-matching ""

    No results matching ""