2022-03-01 22:05:59 +01:00
|
|
|
import { EUser } from 'picsur-shared/dist/entities/user.entity';
|
|
|
|
|
import { Column, Entity, Index, PrimaryGeneratedColumn } from 'typeorm';
|
|
|
|
|
|
|
|
|
|
// Different data for public and private
|
|
|
|
|
|
|
|
|
|
@Entity()
|
|
|
|
|
export class EUserBackend extends EUser {
|
2022-04-01 10:44:41 +02:00
|
|
|
@PrimaryGeneratedColumn("uuid")
|
|
|
|
|
override id?: string;
|
2022-03-01 22:05:59 +01:00
|
|
|
|
|
|
|
|
@Index()
|
2022-03-10 23:02:27 +01:00
|
|
|
@Column({ nullable: false, unique: true })
|
2022-03-01 22:05:59 +01:00
|
|
|
override username: string;
|
|
|
|
|
|
2022-03-10 23:02:27 +01:00
|
|
|
@Column('text', { nullable: false, array: true })
|
2022-03-24 19:56:26 +01:00
|
|
|
override roles: string[];
|
2022-03-01 22:05:59 +01:00
|
|
|
|
2022-03-10 23:02:27 +01:00
|
|
|
@Column({ nullable: false, select: false })
|
2022-03-01 22:05:59 +01:00
|
|
|
override password?: string;
|
|
|
|
|
}
|