24 lines
971 B
MySQL
24 lines
971 B
MySQL
|
|
-- Fixture-to-edge-file associations only. No trajectory files or device state are changed.
|
||
|
|
CREATE TABLE IF NOT EXISTS lab_fixture_trajectory (
|
||
|
|
id varchar(32) NOT NULL,
|
||
|
|
fixture_id bigint NOT NULL,
|
||
|
|
active_fixture_id bigint NULL,
|
||
|
|
version_no int NOT NULL,
|
||
|
|
robot_id varchar(128) NOT NULL,
|
||
|
|
device_id varchar(128) NOT NULL,
|
||
|
|
file_name varchar(255) NOT NULL,
|
||
|
|
samples varchar(20) NOT NULL,
|
||
|
|
duration_s double NOT NULL,
|
||
|
|
sampling_frequency_hz double NOT NULL,
|
||
|
|
status varchar(24) NOT NULL,
|
||
|
|
creator varchar(64) NOT NULL,
|
||
|
|
create_time datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||
|
|
updater varchar(64) NOT NULL,
|
||
|
|
update_time datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||
|
|
tenant_id bigint NOT NULL,
|
||
|
|
PRIMARY KEY(id),
|
||
|
|
UNIQUE KEY uk_fixture_trajectory_current(tenant_id,active_fixture_id),
|
||
|
|
UNIQUE KEY uk_fixture_trajectory_version(tenant_id,fixture_id,version_no),
|
||
|
|
KEY idx_fixture_trajectory_history(tenant_id,fixture_id,create_time)
|
||
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|