import { Column, Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
import { PhoneEntity } from './phone.entity';

@Entity('phone_avatars')
export class PhoneAvatarEntity {
    @PrimaryGeneratedColumn() id: number;
    @Column() phone_id: number;
    @Column({ type: 'varchar', length: 32 }) number: string;
    @Column({ type: 'varchar', length: 36 }) file: string;

    @ManyToOne(() => PhoneEntity, (phone) => phone.avatar)
    @JoinColumn({ name: 'phone_id' })
    phone: PhoneEntity;
}
