diff --git a/db/migrations/20231030123456_invoice_internal.up.sql b/db/migrations/20231030123456_invoice_internal.up.sql new file mode 100644 index 00000000..fe5fef2e --- /dev/null +++ b/db/migrations/20231030123456_invoice_internal.up.sql @@ -0,0 +1,6 @@ +UPDATE invoices +SET internal = false +WHERE internal IS NULL; + +ALTER TABLE invoices +ALTER COLUMN internal SET NOT NULL; \ No newline at end of file diff --git a/db/migrations/20231030123456_invoice_keysend.up.sql b/db/migrations/20231030123456_invoice_keysend.up.sql new file mode 100644 index 00000000..1f76e4b3 --- /dev/null +++ b/db/migrations/20231030123456_invoice_keysend.up.sql @@ -0,0 +1,6 @@ +UPDATE invoices +SET keysend = false +WHERE keysend IS NULL; + +ALTER TABLE invoices +ALTER COLUMN keysend SET NOT NULL; \ No newline at end of file diff --git a/db/models/invoice.go b/db/models/invoice.go index ba03e5fc..c9a84f6a 100644 --- a/db/models/invoice.go +++ b/db/models/invoice.go @@ -22,8 +22,8 @@ type Invoice struct { DestinationCustomRecords map[uint64][]byte `json:"custom_records,omitempty"` RHash string `json:"r_hash"` Preimage string `json:"preimage" bun:",nullzero"` - Internal bool `json:"-" bun:",nullzero"` - Keysend bool `json:"keysend" bun:",nullzero"` + Internal bool `json:"-" bun:",notnull"` + Keysend bool `json:"keysend" bun:",notnull"` State string `json:"state" bun:",default:'initialized'"` ErrorMessage string `json:"error_message,omitempty" bun:",nullzero"` AddIndex uint64 `json:"-" bun:",nullzero"`