I am new this framework Nest JS and created sample Restful API but could not migrate the entity file. I tried many ways it's not working. first time run migration command to generate migration file it's working fine. but second time creating a new entity then run the migration command it's show no changes message how to fix this Issue.
DB config .ts file
{
type: 'postgres',
host: process.env.POSTGRES_HOST,
port: parseInt(process.env.POSTGRES_PORT) || 5432,
database: process.env.POSTGRES_DATABASE,
username: process.env.POSTGRES_USER,
password: process.env.POSTGRES_PASSWORD,
entities: ["dist/**/*.entity{ .ts,.js}"],
synchronize: true,
"migrations": ["dist/migrations/*{.ts,.js}"],
"migrationsTableName": "migrations_typeorm",
// ssl:{
// rejectUnauthorized:false
// }
}
Migration Command
Create and generate migration command
npx typeorm migration:create -n User -d src/migrations
npx typeorm migration:generate -n User -d src/migrations
Run Migration File
npx typeorm migration:run