Skip to content

Commit 2a67468

Browse files
committed
Update devnonce encoding.
1 parent 8191698 commit 2a67468

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ database will be removed!
4545

4646
## Notes
4747

48-
* This utility is compatible with the ChirpStack v4.8.1 database schema.
48+
* This utility is compatible with the ChirpStack v4.10.2 database schema.
4949
* This utility does not support [environment variables](https://www.chirpstack.io/docs/chirpstack/configuration.html#environment-variables) in configuration files, like ChirpStack does.
5050

5151
## Building from source

main.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1917,13 +1917,20 @@ func migrateDeviceKeysFn(tx *sqlx.Tx, devEUIs [][]byte) {
19171917
}
19181918
}
19191919

1920+
devNoncesJSON, err := json.Marshal(map[string][]int64{
1921+
"0000000000000000": devNonces,
1922+
})
1923+
if err != nil {
1924+
log.Fatal("Marshal DevNonces error")
1925+
}
1926+
19201927
_, err = stmt.Exec(
19211928
dk.DevEUI,
19221929
dk.CreatedAt,
19231930
dk.UpdatedAt,
19241931
dk.NwkKey,
19251932
dk.AppKey,
1926-
pq.Int64Array(devNonces),
1933+
string(devNoncesJSON),
19271934
dk.JoinNonce,
19281935
)
19291936
if err != nil {

0 commit comments

Comments
 (0)