You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
543 B
29 lines
543 B
4 years ago
|
import {
|
||
|
Column,
|
||
|
Entity,
|
||
|
JoinColumn,
|
||
|
OneToOne,
|
||
|
PrimaryGeneratedColumn,
|
||
|
} from 'typeorm';
|
||
|
import { User } from './User';
|
||
|
|
||
|
@Entity()
|
||
|
export class UserSettings {
|
||
|
constructor(init?: Partial<UserSettings>) {
|
||
|
Object.assign(this, init);
|
||
|
}
|
||
|
|
||
|
@PrimaryGeneratedColumn()
|
||
|
public id: number;
|
||
|
|
||
|
@OneToOne(() => User, (user) => user.settings, { onDelete: 'CASCADE' })
|
||
|
@JoinColumn()
|
||
|
public user: User;
|
||
|
|
||
|
@Column({ default: true })
|
||
|
public enableNotifications: boolean;
|
||
|
|
||
|
@Column({ nullable: true })
|
||
|
public discordId?: string;
|
||
|
}
|