mirror of
https://github.com/spacebarchat/server.git
synced 2026-04-05 12:55:43 +00:00
Generate IDs for entities by default
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user