chore: Synchronizing refactor and small fixes from enterprise codebase (#3634)
* chore: Syncronizing refactor and small fixes from enterprise codebase * fix
This commit is contained in:
26
server/models/base/IdModel.ts
Normal file
26
server/models/base/IdModel.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import {
|
||||
CreatedAt,
|
||||
UpdatedAt,
|
||||
Column,
|
||||
PrimaryKey,
|
||||
IsUUID,
|
||||
DataType,
|
||||
Default,
|
||||
} from "sequelize-typescript";
|
||||
import BaseModel from "./BaseModel";
|
||||
|
||||
class IdModel extends BaseModel {
|
||||
@IsUUID(4)
|
||||
@PrimaryKey
|
||||
@Default(DataType.UUIDV4)
|
||||
@Column(DataType.UUID)
|
||||
id: string;
|
||||
|
||||
@CreatedAt
|
||||
createdAt: Date;
|
||||
|
||||
@UpdatedAt
|
||||
updatedAt: Date;
|
||||
}
|
||||
|
||||
export default IdModel;
|
||||
Reference in New Issue
Block a user