summary refs log tree commit diff
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-09-28 16:07:58 +1000
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-09-28 16:07:58 +1000
commit6fcf0250d745c903c406298ec58fd50234dfe553 (patch)
treead7bf1fbe9410ba9d78057d61e6c78b64644ae1c
parentFix user validator preventing update (diff)
downloadserver-6fcf0250d745c903c406298ec58fd50234dfe553.tar.xz
Generate IDs for entities by default
-rw-r--r--src/util/entities/BaseClass.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/util/entities/BaseClass.ts b/src/util/entities/BaseClass.ts
index 9942b60e..74088b1e 100644
--- a/src/util/entities/BaseClass.ts
+++ b/src/util/entities/BaseClass.ts
@@ -3,6 +3,7 @@ import {
 	BaseEntity,
 	BeforeInsert,
 	BeforeUpdate,
+	DeepPartial,
 	FindOptionsWhere,
 	ObjectIdColumn,
 	PrimaryColumn,
@@ -66,7 +67,7 @@ export const PrimaryIdColumn = process.env.DATABASE?.startsWith("mongodb")
 
 export class BaseClass extends BaseClassWithoutId {
 	@PrimaryIdColumn()
-	id: string;
+	id: string = Snowflake.generate();
 
 	@BeforeUpdate()
 	@BeforeInsert()