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:
parent
add54e6b68
commit
550b830f46
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user