64 lines
1.1 KiB
TypeScript
64 lines
1.1 KiB
TypeScript
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, Index } from 'typeorm';
|
|
|
|
import { ActivityType } from '../types/action';
|
|
|
|
@Entity('user_activities')
|
|
export class UserActivity {
|
|
@PrimaryGeneratedColumn('uuid')
|
|
id: string;
|
|
|
|
@Index()
|
|
@Column({
|
|
type: 'uuid'
|
|
})
|
|
id_user: string;
|
|
|
|
@Index()
|
|
@Column({
|
|
type: 'uuid'
|
|
})
|
|
refresh_token: string;
|
|
|
|
@Index()
|
|
@Column({
|
|
nullable: false,
|
|
length: 512
|
|
})
|
|
module: string;
|
|
|
|
@Column({
|
|
nullable: false,
|
|
length: 2048
|
|
})
|
|
description: string;
|
|
|
|
@Column({
|
|
nullable: true,
|
|
length: 1
|
|
})
|
|
action: ActivityType;
|
|
|
|
@Column({
|
|
nullable: false,
|
|
length: 2048,
|
|
})
|
|
url: String;
|
|
|
|
@Column({
|
|
type: 'text',
|
|
nullable: true,
|
|
})
|
|
data_body: String;
|
|
|
|
@Column()
|
|
@CreateDateColumn()
|
|
created_at: Date;
|
|
|
|
@Column({ nullable: true })
|
|
@UpdateDateColumn()
|
|
updated_at: Date;
|
|
|
|
@Column({ nullable: true })
|
|
@DeleteDateColumn()
|
|
deleted_at: Date;
|
|
} |