79623341

Date: 2025-05-15 12:46:26
Score: 0.5
Natty:
Report link

After hours of debugging, I found what the issue was. Each of my entity class was decorated with the below decorator

@Entity({ name: "table_name", synchronize: false })

I mark all the entities with synchronize: false to avoid any accidental schema changes, as if I enable the synchronization on data source level, it will apply to all the entities (or tables).

Setting this to synchronize: true enabled typeorm to consider this entity for migration, and thus, I were able to generate migrations for all modified entities by temporarily enabling this synchronization attribute for entities requiring migration script to be generated automatically.

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Abhishek