cambiatus / backend

Cambiatus GraphQL API
GNU Affero General Public License v3.0
20 stars 18 forks source link

Script para atualização de campos com string vazia #270

Closed MatheusBuss closed 2 years ago

MatheusBuss commented 2 years ago

What issue does this PR close

Closes #266

Changes Proposed ( a list of new changes introduced by this PR)

Criar script para detectar valores "" já existentes na db e atualizá-los para nil

How to test ( a list of instructions on how to test this PR)

  1. Procurar na db por valores com ''
  2. Executar iex -S mix priv/repo/null_string.exs
  3. Verficar se os valores foram alterados para NULL
MatheusBuss commented 2 years ago

São esses os campos que encontrei. Ainda não mudei todos no event-source. Se batermos o martelo aqui já atualizo o PR de lá também!

lucca65 commented 2 years ago

Because if not, we may end up with the same problem in the future, a simple migration adding this constraint should be enough to make sure we will not end up with a dirty db

MatheusBuss commented 2 years ago

Because if not, we may end up with the same problem in the future, a simple migration adding this constraint should be enough to make sure we will not end up with a dirty db

Makes a ton of sense. I've added some simple constraints on the fields we discussed.