Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
838 B
2
Indexable
Never
import { Column, Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
import { BaseModel } from './base.entity';
import { UserEntity } from './user.entity';

@Entity('auth')
export class AuthEntity extends BaseModel {
  @PrimaryGeneratedColumn('identity', {
    type: 'bigint',
  })
  user_auth_id: string;

  @ManyToOne(() => UserEntity, (user) => user.user_profile_id, {
    nullable: true,
  })
  @JoinColumn({
    name: 'user_profile_id',
  })
  user: UserEntity;

  @Column({
    type: 'bigint',
    nullable: true,
  })
  user_profile_id_virtual: string;

  @Column({
    type: 'text',
    default: '',
  })
  access_token: string;

  @Column({
    type: 'int',
    default: 0,
  })
  status: number;

  @Column({
    type: 'int',
    default: 0,
  })
  type: number;
}