Skip to content
On this page

TenantEntity: Tenant base entity

This class extends BaseEntity, and add extra tenantId field describe which tenant owns this data.

Usage

typescript
import { Entity, Column } from 'typeorm';
import { TenantEntity } from '@yunology/ts-multi-tenancy';

@Entity()
export class User extends TenantEntity {
  @Column({ type: 'text' })
  name!: string;
}