Skip to content

Commit 4850f1a

Browse files
committed
Update to ChirpStack v4.4.0 db schema.
1 parent 070d1ef commit 4850f1a

File tree

2 files changed

+56
-5
lines changed

2 files changed

+56
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ will drop all tenants and users from the ChirpStack v4 database.
3232

3333
## Notes
3434

35-
* This utilty is compatible with the ChirpStack v4.2.0 or later database schema.
35+
* This utilty is compatible with the ChirpStack v4.4.0 or later database schema.
3636
* This utilty does not support [environment variables](https://www.chirpstack.io/docs/chirpstack/configuration.html#environment-variables) in configuration files, like ChirpStack does.
3737

3838
## Building from source

main.go

Lines changed: 55 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,8 +1004,35 @@ function encodeDownlink(input) {
10041004
flush_queue_on_activate,
10051005
measurements,
10061006
auto_detect_measurements,
1007-
region_config_id
1008-
) values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23, $24, $25, $26, $27, $28, $29, $30, $31)`,
1007+
region_config_id,
1008+
is_relay,
1009+
is_relay_ed,
1010+
relay_ed_relay_only,
1011+
relay_enabled,
1012+
relay_cad_periodicity,
1013+
relay_default_channel_index,
1014+
relay_second_channel_freq,
1015+
relay_second_channel_dr,
1016+
relay_second_channel_ack_offset,
1017+
relay_ed_activation_mode,
1018+
relay_ed_smart_enable_level,
1019+
relay_ed_back_off,
1020+
relay_ed_uplink_limit_bucket_size,
1021+
relay_ed_uplink_limit_reload_rate,
1022+
relay_join_req_limit_reload_rate,
1023+
relay_notify_limit_reload_rate,
1024+
relay_global_uplink_limit_reload_rate,
1025+
relay_overall_limit_reload_rate,
1026+
relay_join_req_limit_bucket_size,
1027+
relay_notify_limit_bucket_size,
1028+
relay_global_uplink_limit_bucket_size,
1029+
relay_overall_limit_bucket_size
1030+
) values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10,
1031+
$11, $12, $13, $14, $15, $16, $17, $18, $19, $20,
1032+
$21, $22, $23, $24, $25, $26, $27, $28, $29, $30,
1033+
$31, $32, $33, $34, $35, $36, $37, $38, $39, $40,
1034+
$41, $42, $43, $44, $45, $46, $47, $48, $49, $50,
1035+
$51, $52, $53)`,
10091036
nsDP.ID,
10101037
intToUUID(asDP.OrganizationID),
10111038
asDP.CreatedAt,
@@ -1037,6 +1064,28 @@ function encodeDownlink(input) {
10371064
"{}",
10381065
true,
10391066
nil,
1067+
false,
1068+
false,
1069+
false,
1070+
false,
1071+
0,
1072+
0,
1073+
0,
1074+
0,
1075+
0,
1076+
0,
1077+
0,
1078+
0,
1079+
0,
1080+
0,
1081+
0,
1082+
0,
1083+
0,
1084+
0,
1085+
0,
1086+
0,
1087+
0,
1088+
0,
10401089
)
10411090
if err != nil {
10421091
panic(err)
@@ -1124,8 +1173,9 @@ func migrateDevices() {
11241173
skip_fcnt_check,
11251174
is_disabled,
11261175
tags,
1127-
variables
1128-
) values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22)`,
1176+
variables,
1177+
join_eui
1178+
) values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23)`,
11291179
dev.DevEUI,
11301180
intToUUID(asDEV.ApplicationID),
11311181
asDEV.DeviceProfileID,
@@ -1148,6 +1198,7 @@ func migrateDevices() {
11481198
dev.IsDisabled,
11491199
hstoreToJSON(asDEV.Tags),
11501200
hstoreToJSON(asDEV.Variables),
1201+
[]byte{0, 0, 0, 0, 0, 0, 0, 0},
11511202
)
11521203
if err != nil {
11531204
panic(err)

0 commit comments

Comments
 (0)