HB, OTA etc

This commit is contained in:
2026-04-22 20:11:55 +03:00
parent 4100931deb
commit cb1014c950
76 changed files with 3157 additions and 232 deletions

View File

@@ -0,0 +1,24 @@
create table firmware (
id int not null auto_increment,
device_id bigint not null,
version int not null,
path varchar(4096) not null,
sha256 char(64),
size int,
uploaded_at timestamp not null default current_timestamp,
primary key (id),
foreign key (device_id) references devices(id),
unique(device_id, version)
);
create table firmware_updates (
id int not null auto_increment,
firmware_id int not null,
status varchar(32) not null, -- pending / sent / applied / failed
requested_at timestamp not null default current_timestamp,
applied_at timestamp null,
primary key (id),
foreign key (firmware_id) references firmware(id)
);