Calls didn't enforce that `call_type` and `input` was not `NULL`. Creates didn't enforce that `init` was not `NULL`.pull/1094/head
parent
838a312ff6
commit
0c4c80c880
@ -0,0 +1,15 @@ |
||||
defmodule Explorer.Repo.Migrations.AdditionalInternalTransactionConstraints do |
||||
use Ecto.Migration |
||||
|
||||
def up do |
||||
create(constraint(:internal_transactions, :call_has_call_type, check: "type != 'call' OR call_type IS NOT NULL")) |
||||
create(constraint(:internal_transactions, :call_has_input, check: "type != 'call' OR input IS NOT NULL")) |
||||
create(constraint(:internal_transactions, :create_has_init, check: "type != 'create' OR init IS NOT NULL")) |
||||
end |
||||
|
||||
def down do |
||||
drop(constraint(:internal_transactions, :call_has_call_type)) |
||||
drop(constraint(:internal_transactions, :call_has_input)) |
||||
drop(constraint(:internal_transactions, :create_has_init)) |
||||
end |
||||
end |
Loading…
Reference in new issue