feat: kysely migrations (#17198)
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import { DatabaseAction, EntityType } from 'src/enum';
|
||||
import { Column, CreateDateColumn, Index, PrimaryColumn, Table } from 'src/sql-tools';
|
||||
|
||||
@Table('audit')
|
||||
@Index({ name: 'IDX_ownerId_createdAt', columns: ['ownerId', 'createdAt'] })
|
||||
export class AuditTable {
|
||||
@PrimaryColumn({ type: 'integer', default: 'increment', synchronize: false })
|
||||
id!: number;
|
||||
|
||||
@Column()
|
||||
entityType!: EntityType;
|
||||
|
||||
@Column({ type: 'uuid' })
|
||||
entityId!: string;
|
||||
|
||||
@Column()
|
||||
action!: DatabaseAction;
|
||||
|
||||
@Column({ type: 'uuid' })
|
||||
ownerId!: string;
|
||||
|
||||
@CreateDateColumn()
|
||||
createdAt!: Date;
|
||||
}
|
||||
Reference in New Issue
Block a user