NestJS - Database with TypeORMA migration runs but does not apply changes to the database. What is a common mistake causing this?AUsing async functions for migration methodsBDefining both up() and down() methodsCNaming the migration class incorrectlyDNot calling the queryRunner.query() inside up()Check Answer
Step-by-Step SolutionSolution:Step 1: Identify why migration has no effectIf queryRunner.query() is not called, no SQL commands run to change the database.Step 2: Understand method rolesup() must execute queries to apply schema changes.Final Answer:Not calling the queryRunner.query() inside up() -> Option DQuick Check:Missing queryRunner.query() = no DB changes [OK]Quick Trick: Always run queries inside up() to apply changes [OK]Common Mistakes:Thinking async functions cause no effectBelieving down() method affects applying changesAssuming class name affects migration execution
Master "Database with TypeORM" in NestJS9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallPerf
More NestJS Quizzes Authentication - Protected routes with guards - Quiz 11easy Database with Prisma - Prisma Client usage - Quiz 14medium Database with Prisma - Prisma migrations - Quiz 14medium Database with TypeORM - Transactions - Quiz 3easy Database with TypeORM - Entity definition - Quiz 3easy Database with TypeORM - Entity definition - Quiz 14medium Interceptors - Response transformation - Quiz 5medium Pipes - Why pipes transform and validate input - Quiz 14medium Pipes - Pipe binding (parameter, method, controller, global) - Quiz 4medium Pipes - File validation pipe - Quiz 7medium