Nest framework with typeorm and mysql the Column default property is modifying the database values to default value on every server reloading

Viewed 2643

I created a TypeORM entity @Column({default: 'I tied with a lot of type and more value'}) what returns to original value ( what is in default 'I tried... ) on every server reload or code modification with watcher.

@Column({default: 'I tied with a lot of type and more  value'})
is_active: string;
2 Answers

I removed the dist directory after it worked well.

I think I would need a bit more clarification to really understand what is happening, but it sounds like you may have synchronize: true in your TypeORM config. This will make TypeORM re-run all of its set up functions (table creations, column modifications, etc.) on server startup.

Related