|
|
|
|
|
by acimim_ha
777 days ago
|
|
> Case 2. Misuse of IF [NOT] EXISTS The article doesn't provide any good example of misuse. And that's exactly how you use it. It's clean and simple, no hidden pitfalls.
Schema migration tools are overhead when you have a few tables. |
|
In this particular case, the "bad data" is a table/column/view that exists (or doesn't) when it should(n't). Why does the table exist when it shouldn't yet exist? Did it fail to get dropped? Is the existing one the right schema? Is the same migration erroneously running twice?
After each migration, your schema should be in a precise state. If the phrase "IF [NOT] EXISTS" is in your migration, then after a previous migration, it wasn't left in a precise state. Being uncertain about the state of your schema isn't great.