1
0
forked from mirror/misskey
mi.moris.day/packages/backend/src/models/UsedUsername.ts

30 lines
635 B
TypeScript
Raw Normal View History

/*
* SPDX-FileCopyrightText: syuilo and other misskey contributors
* SPDX-License-Identifier: AGPL-3.0-only
*/
import { PrimaryColumn, Entity, Column, Index } from 'typeorm';
2019-07-22 10:15:00 +09:00
@Entity('used_username')
export class MiUsedUsername {
2019-07-22 10:15:00 +09:00
@PrimaryColumn('varchar', {
length: 128,
})
public username: string;
@Index()
@Column('timestamp with time zone', {
comment: 'The created date of the UsedUsername.',
default: () => 'CURRENT_TIMESTAMP',
})
2019-07-22 10:15:00 +09:00
public createdAt: Date;
constructor(data: Partial<MiUsedUsername>) {
2019-07-22 10:15:00 +09:00
if (data == null) return;
for (const [k, v] of Object.entries(data)) {
(this as any)[k] = v;
}
}
}