File

src/entity/user-unique-field.entity.ts

Index

Properties

Properties

id
Type : number
Decorators :
@PrimaryGeneratedColumn({unsigned: true})
name
Type : string | null
Decorators :
@Column({nullable: true, length: 255})
user
Type : User
Decorators :
@ManyToOne(undefined, undefined, {onDelete: 'CASCADE', onUpdate: 'CASCADE'})
value
Type : string | null
Decorators :
@Column({nullable: true, length: 255})
import { Column, Entity, ManyToOne, OneToMany, PrimaryGeneratedColumn } from "typeorm";
import { User } from "./user.entity";

@Entity()
export class UserUniqueFiled {

    @PrimaryGeneratedColumn({
        unsigned: true
    })
    id: number;

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

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

    @ManyToOne(type => User, user => user.userUniqueField, { onDelete: 'CASCADE', onUpdate: 'CASCADE' })
    user: User;

}

result-matching ""

    No results matching ""