mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-22 23:16:46 +00:00
refactor(db): every entity in the snake_case shape; document-sync entities added; one repository per entity
This commit is contained in:
@@ -1,24 +1,23 @@
|
||||
import { PrimaryKeyProp, defineEntity, p, EntityRepository } from '@mikro-orm/core';
|
||||
import { PrimaryKeyProp, defineEntity, p } from '@mikro-orm/core';
|
||||
import { PluginOauthStateRepository } from '../repositories/PluginOauthState.repository';
|
||||
|
||||
export class PluginOauthState {
|
||||
[PrimaryKeyProp]?: 'state';
|
||||
state?: string | null;
|
||||
pluginId!: string;
|
||||
userId!: number;
|
||||
plugin_id!: string;
|
||||
user_id!: number;
|
||||
verifier!: string;
|
||||
createdAt!: number;
|
||||
created_at!: number;
|
||||
}
|
||||
|
||||
export class PluginOauthStateRepository extends EntityRepository<PluginOauthState> {}
|
||||
|
||||
export const PluginOauthStateSchema = defineEntity({
|
||||
class: PluginOauthState,
|
||||
repository: () => PluginOauthStateRepository,
|
||||
properties: {
|
||||
state: p.text().primary().nullable(),
|
||||
pluginId: p.text(),
|
||||
userId: p.integer(),
|
||||
plugin_id: p.text(),
|
||||
user_id: p.integer(),
|
||||
verifier: p.text(),
|
||||
createdAt: p.integer(),
|
||||
created_at: p.integer(),
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user