From 550b830f465d3adc8768c3dbe36aefc6ced678e2 Mon Sep 17 00:00:00 2001 From: Madeline <46743919+MaddyUnderStars@users.noreply.github.com> Date: Wed, 28 Sep 2022 16:07:58 +1000 Subject: Generate IDs for entities by default --- src/util/entities/BaseClass.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') 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() -- cgit 1.4.1