nestjs / typeorm

TypeORM module for Nest framework (node.js) 🍇

Home Page:https://nestjs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Every migration:generate creates DROP/CREATES constraints and keys

amilkarSingular opened this issue · comments

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

When I run migration:generate and migration:run and the first time it generate me the CREATE TABLE and index fine and migrations runs perfect, but at the second time (without change anything in tables), it generate me ALTER TABLE DROP and ADD constraints queries of all entities again, like if synchronize was turn on.

Minimum reproduction code

https://github.com

Steps to reproduce

npm run migration:generate
npm run migration:run

Expected behavior

At the second time without any changes in entities, the output of migration:generate should be empty in up() and down() functions.

At the next time with some changes in entities, the output should be SQL queries with only the changes I made, not changes I made + DROP/CREATES constraints.

Even I run it it throw me error saying "some constraints already exists"

Package version

10.0.1

NestJS version

10.2.4

Node.js version

21.1.0

In which operating systems have you tested?

  • macOS
  • Windows
  • Linux

Other

No response

this has nothing to do with @nestjs/typeorm

please report this to https://github.com/typeorm/typeorm