feat: reworked command processing and storage
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
-- Add migration script here
|
||||
|
||||
ALTER TABLE beacon_instance ADD COLUMN version int NOT NULL DEFAULT 512;
|
||||
27
sparse-server/migrations/20250223215600_commands_v2.sql
Normal file
27
sparse-server/migrations/20250223215600_commands_v2.sql
Normal file
@@ -0,0 +1,27 @@
|
||||
-- Add migration script here
|
||||
DROP TABLE beacon_command_invocation;
|
||||
DROP TABLE beacon_command;
|
||||
|
||||
CREATE TABLE beacon_command (
|
||||
command_id integer PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||
|
||||
cmd_parameters varchar NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE beacon_command_invocation (
|
||||
beacon_id varchar NOT NULL,
|
||||
command_id int NOT NULL,
|
||||
|
||||
issue_date int NOT NULL,
|
||||
|
||||
invoker_id int NOT NULL,
|
||||
|
||||
invocation_date int,
|
||||
invocation_result varchar,
|
||||
|
||||
PRIMARY KEY (beacon_id, command_id),
|
||||
|
||||
FOREIGN KEY (command_id) REFERENCES beacon_command,
|
||||
FOREIGN KEY (beacon_id) REFERENCES beacon_instance,
|
||||
FOREIGN KEY (invoker_id) REFERENCES users
|
||||
);
|
||||
Reference in New Issue
Block a user