mirror of
https://github.com/samanhappy/mcphub.git
synced 2026-01-11 09:07:01 -05:00
34 lines
655 B
TypeScript
34 lines
655 B
TypeScript
import {
|
|
Entity,
|
|
Column,
|
|
PrimaryGeneratedColumn,
|
|
CreateDateColumn,
|
|
UpdateDateColumn,
|
|
} from 'typeorm';
|
|
|
|
/**
|
|
* User entity for database storage
|
|
*/
|
|
@Entity({ name: 'users' })
|
|
export class User {
|
|
@PrimaryGeneratedColumn('uuid')
|
|
id: string;
|
|
|
|
@Column({ type: 'varchar', length: 255, unique: true })
|
|
username: string;
|
|
|
|
@Column({ type: 'varchar', length: 255 })
|
|
password: string;
|
|
|
|
@Column({ type: 'boolean', default: false })
|
|
isAdmin: boolean;
|
|
|
|
@CreateDateColumn({ name: 'created_at', type: 'timestamp' })
|
|
createdAt: Date;
|
|
|
|
@UpdateDateColumn({ name: 'updated_at', type: 'timestamp' })
|
|
updatedAt: Date;
|
|
}
|
|
|
|
export default User;
|