1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-22 18:32:29 +01:00

Generate IDs for entities by default

This commit is contained in:
Madeline 2022-09-28 16:07:58 +10:00
parent add54e6b68
commit 550b830f46

View File

@ -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()