summaryrefslogtreecommitdiff
path: root/packages/backend/src/models/entities/UsedUsername.ts
blob: eb90bef6ca1f88a760888edfee7328c6a2fc3f0b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import { PrimaryColumn, Entity, Column } from 'typeorm';

@Entity()
export class UsedUsername {
	@PrimaryColumn('varchar', {
		length: 128,
	})
	public username: string;

	@Column('timestamp with time zone')
	public createdAt: Date;

	constructor(data: Partial<UsedUsername>) {
		if (data == null) return;

		for (const [k, v] of Object.entries(data)) {
			(this as any)[k] = v;
		}
	}
}