This commit is contained in:
Bastian Wagner
2026-07-20 09:01:36 +02:00
parent 8cf57d7878
commit e62673ac11
98 changed files with 17372 additions and 80 deletions

View File

@@ -0,0 +1,43 @@
import {
Column,
CreateDateColumn,
Entity,
Index,
JoinColumn,
ManyToOne,
PrimaryGeneratedColumn,
} from 'typeorm';
import { UserEntity } from '../../users/entities/user.entity';
import { ProjectEntity } from './project.entity';
@Entity('project_activities')
export class ProjectActivityEntity {
@PrimaryGeneratedColumn('uuid')
id!: string;
@ManyToOne(() => ProjectEntity, (project) => project.activities, {
onDelete: 'CASCADE',
})
@JoinColumn({ name: 'project_id' })
project!: ProjectEntity;
@Index('idx_project_activities_project_created')
@Column({ name: 'project_id', type: 'char', length: 36 })
projectId!: string;
@ManyToOne(() => UserEntity, { nullable: true, onDelete: 'SET NULL' })
@JoinColumn({ name: 'actor_user_id' })
actorUser!: UserEntity | null;
@Column({ name: 'actor_user_id', type: 'char', length: 36, nullable: true })
actorUserId!: string | null;
@Column({ type: 'varchar', length: 80 })
action!: string;
@Column({ type: 'json', nullable: true })
metadata!: Record<string, string | number | boolean | null> | null;
@CreateDateColumn({ name: 'created_at', type: 'datetime', precision: 3 })
createdAt!: Date;
}