40 lines
933 B
TypeScript
40 lines
933 B
TypeScript
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, ManyToOne, JoinColumn } from 'typeorm';
|
|
import { Tenant } from '../tenants/tenant.entity';
|
|
|
|
@Entity('projects')
|
|
export class Project {
|
|
@PrimaryGeneratedColumn('uuid')
|
|
id: string;
|
|
|
|
@Column({ type: 'uuid' })
|
|
tenant_id: string;
|
|
|
|
@ManyToOne(() => Tenant)
|
|
@JoinColumn({ name: 'tenant_id' })
|
|
tenant: Tenant;
|
|
|
|
@Column()
|
|
name: string;
|
|
|
|
@Column({ type: 'text', nullable: true })
|
|
description: string;
|
|
|
|
@Column({ type: 'text', nullable: true })
|
|
wiki_content: string;
|
|
|
|
@Column({ type: 'ltree' })
|
|
path: string;
|
|
|
|
@Column({ type: 'uuid', nullable: true })
|
|
parent_id: string;
|
|
|
|
@Column({ type: 'jsonb', default: {} })
|
|
attributes: Record<string, any>;
|
|
|
|
@CreateDateColumn({ name: 'created_at' })
|
|
createdAt: Date;
|
|
|
|
@UpdateDateColumn({ name: 'updated_at' })
|
|
updatedAt: Date;
|
|
}
|