Skip to content

Commit afaf6fd

Browse files
committed
chore: migrate internal and keysend columns to be non null
1 parent 5880dfe commit afaf6fd

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
UPDATE invoices
2+
SET internal = false
3+
WHERE internal IS NULL;
4+
5+
ALTER TABLE invoices
6+
ALTER COLUMN internal SET NOT NULL;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
UPDATE invoices
2+
SET keysend = false
3+
WHERE keysend IS NULL;
4+
5+
ALTER TABLE invoices
6+
ALTER COLUMN keysend SET NOT NULL;

db/models/invoice.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ type Invoice struct {
2222
DestinationCustomRecords map[uint64][]byte `json:"custom_records,omitempty"`
2323
RHash string `json:"r_hash"`
2424
Preimage string `json:"preimage" bun:",nullzero"`
25-
Internal bool `json:"-" bun:",nullzero"`
26-
Keysend bool `json:"keysend" bun:",nullzero"`
25+
Internal bool `json:"-" bun:",notnull"`
26+
Keysend bool `json:"keysend" bun:",notnull"`
2727
State string `json:"state" bun:",default:'initialized'"`
2828
ErrorMessage string `json:"error_message,omitempty" bun:",nullzero"`
2929
AddIndex uint64 `json:"-" bun:",nullzero"`

0 commit comments

Comments
 (0)