summary refs log tree commit diff
path: root/util/src/entities/BaseClass.ts
diff options
context:
space:
mode:
Diffstat (limited to 'util/src/entities/BaseClass.ts')
-rw-r--r--util/src/entities/BaseClass.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/util/src/entities/BaseClass.ts b/util/src/entities/BaseClass.ts
index d18757f2..f105086a 100644
--- a/util/src/entities/BaseClass.ts
+++ b/util/src/entities/BaseClass.ts
@@ -5,10 +5,8 @@ import {
 	BeforeUpdate,
 	EntityMetadata,
 	FindConditions,
-	getConnection,
-	getManager,
+	ObjectIdColumn,
 	PrimaryColumn,
-	RemoveOptions,
 } from "typeorm";
 import { Snowflake } from "../util/Snowflake";
 import "missing-native-js-functions";
@@ -117,8 +115,10 @@ export class BaseClassWithoutId extends BaseEntity {
 	// }
 }
 
+export const PrimaryIdColumn = process.env.DATABASE?.startsWith("mongodb") ? ObjectIdColumn : PrimaryColumn;
+
 export class BaseClass extends BaseClassWithoutId {
-	@PrimaryColumn()
+	@PrimaryIdColumn()
 	id: string;
 
 	assign(props: any = {}) {