Pankaj Cheema
Pankaj Cheema

Reputation: 1058

Typeorm migration generate command including some fields again in each migration while the previous migration generated that field

@Column({ nullable: true, default: null })
baseCurrency: string;   

@Column({ nullable: true, default: null })
description: string;

I am having an entity in which above fields are defined , these fields are included in migration .

after generating the migration I am running typeorm migration:run so as per documentation , when i will run generate again then there should be nothing because i didn't change anything but in new migration these two deilds are there .

Any suggestion please

Upvotes: 0

Views: 401

Answers (2)

Mario586
Mario586

Reputation: 27

I encountered the same issue and this worked for me:

@Column({ nullable: true, default: () => "NULL" })
baseCurrency: string;   

@Column({ nullable: true, default: () => "NULL" })
description: string;

Upvotes: 0

Thang
Thang

Reputation: 31

Im facing the same issue with

  • typeorm 0.2.32
  • mysql 2.18.1

So far I have found that both nullable: true and default: true cause the problem.

What helped was trying the rc version of typeorm

npm install [email protected]

Upvotes: 1

Related Questions