mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-22 16:38:21 +00:00
Added useful indexes to the entities for query optimization
This commit is contained in:
parent
b1f3c12995
commit
962b7dc8b1
3 changed files with 9 additions and 1 deletions
|
|
@ -3,6 +3,7 @@ import {
|
|||
Column,
|
||||
CreateDateColumn,
|
||||
Entity,
|
||||
Index,
|
||||
JoinColumn,
|
||||
ManyToOne,
|
||||
OneToMany,
|
||||
|
|
@ -20,6 +21,7 @@ export class GroupPermissions extends BaseEntity {
|
|||
@PrimaryGeneratedColumn('uuid')
|
||||
id: string;
|
||||
|
||||
@Index()
|
||||
@Column({ name: 'organization_id', nullable: false })
|
||||
organizationId: string;
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ import {
|
|||
Column,
|
||||
CreateDateColumn,
|
||||
Entity,
|
||||
Index,
|
||||
JoinColumn,
|
||||
ManyToOne,
|
||||
PrimaryGeneratedColumn,
|
||||
|
|
@ -16,9 +17,11 @@ export class GroupUsers extends BaseEntity {
|
|||
@PrimaryGeneratedColumn('uuid')
|
||||
id: string;
|
||||
|
||||
@Index()
|
||||
@Column({ name: 'user_id', nullable: false })
|
||||
userId: string;
|
||||
|
||||
@Index()
|
||||
@Column({ name: 'group_id', nullable: false })
|
||||
groupId: string;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { Entity, PrimaryGeneratedColumn, Column, ManyToOne, JoinColumn, CreateDateColumn } from 'typeorm';
|
||||
import { Entity, PrimaryGeneratedColumn, Column, ManyToOne, JoinColumn, CreateDateColumn, Index } from 'typeorm';
|
||||
import { User } from './user.entity';
|
||||
import { PagePermission } from './page_permissions.entity';
|
||||
import { GroupPermissions } from './group_permissions.entity';
|
||||
|
|
@ -8,12 +8,15 @@ export class PageUser {
|
|||
@PrimaryGeneratedColumn('uuid')
|
||||
id: string;
|
||||
|
||||
@Index()
|
||||
@Column({ name: 'page_permissions_id', type: 'uuid' })
|
||||
pagePermissionsId: string;
|
||||
|
||||
@Index()
|
||||
@Column({ name: 'user_id', type: 'uuid', nullable: true })
|
||||
userId: string | null;
|
||||
|
||||
@Index()
|
||||
@Column({ name: 'permission_groups_id', type: 'uuid', nullable: true })
|
||||
permissionGroupsId: string | null;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue