mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-03 17:41:51 +00:00
rename entities
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import { type Opt, PrimaryKeyProp, type Ref, defineEntity, p, EntityRepository } from '@mikro-orm/core';
|
||||
import { Users } from './Users.entity';
|
||||
|
||||
export class NotificationChannelPreferences {
|
||||
[PrimaryKeyProp]?: ['user', 'eventType', 'channel'];
|
||||
user!: Ref<Users>;
|
||||
eventType!: string;
|
||||
channel!: string;
|
||||
enabled: number & Opt = 1;
|
||||
}
|
||||
|
||||
export class NotificationChannelPreferencesRepository extends EntityRepository<NotificationChannelPreferences> {}
|
||||
|
||||
export const NotificationChannelPreferencesSchema = defineEntity({
|
||||
class: NotificationChannelPreferences,
|
||||
repository: () => NotificationChannelPreferencesRepository,
|
||||
properties: {
|
||||
user: () => p.manyToOne(Users).primary().ref().deleteRule('cascade').index('idx_ncp_user'),
|
||||
eventType: p.text().primary(),
|
||||
channel: p.text().primary(),
|
||||
enabled: p.integer(),
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user