feat: implement QuestionBank CRUD with pagination and template query
- Add pagination support to findAll (page, limit query params) - Add findByTemplateId method to service - Add GET /by-template/:templateId endpoint to controller - Service already includes CRUD for QuestionBank and QuestionBankItem
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import { MigrationInterface, QueryRunner } from 'typeorm';
|
||||
|
||||
export class AddParentIdToKnowledgeGroups1772340000000 implements MigrationInterface {
|
||||
name = 'AddParentIdToKnowledgeGroups1772340000000';
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
// Add parent_id column to knowledge_groups table
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "knowledge_groups" ADD COLUMN "parent_id" text REFERENCES "knowledge_groups"("id") ON DELETE SET NULL`,
|
||||
);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "knowledge_groups" DROP COLUMN "parent_id"`,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user