Search code examples
mysqlnode.jsgitgit-pullnode.js-typeorm

What could be causing MYSQL table values to be changed to NULL after performing a Git pull?


I'm working on an API on my local machine, I have a MYSQL database that has multiple tables, I've noticed that when I push my changes to GitHub and pull them onto the server one of the tables has all of the values except for the ID and name columns changed to NULL. It only happens to this one table so I compared the code for that table to others that don't experience this bug but there isn't anything obviously different that would be causing it.

I can provide code segments if that helps but since I am at such a loss as to what would be causing it, I don't know what code would be relevant to include in this post to help.

I should also mention I don't get this bug on my local machine anytime I run any npm commands, it only happens on the server after doing Git Pull.


Solution

  • So upon further inspection, it didn't have anything to do with the table's code itself, it had to do with the ORM config file.

    https://docs.nestjs.com/techniques/database

    Just had to change "synchronize" to false.