17 lines
406 B
TypeScript
17 lines
406 B
TypeScript
import { CreateDateColumn, PrimaryColumn, UpdateDateColumn } from "typeorm"
|
|
import { resolveDbType } from "../db-aware-column"
|
|
|
|
/**
|
|
* Base abstract entity for all entities
|
|
*/
|
|
export abstract class BaseEntity {
|
|
@PrimaryColumn()
|
|
id: string
|
|
|
|
@CreateDateColumn({ type: resolveDbType("timestamptz") })
|
|
created_at: Date
|
|
|
|
@UpdateDateColumn({ type: resolveDbType("timestamptz") })
|
|
updated_at: Date
|
|
}
|