14 lines
576 B
MySQL
14 lines
576 B
MySQL
|
|
-- Optional evidence for individual receipt / move operations; no business rows are rewritten.
|
||
|
|
CREATE TABLE IF NOT EXISTS warehouse_operation_photo (
|
||
|
|
id varchar(36) NOT NULL PRIMARY KEY,
|
||
|
|
kind varchar(8) NOT NULL,
|
||
|
|
record_id bigint DEFAULT NULL,
|
||
|
|
owner_id bigint NOT NULL,
|
||
|
|
name varchar(255) NOT NULL,
|
||
|
|
content_type varchar(64) NOT NULL,
|
||
|
|
byte_size int NOT NULL,
|
||
|
|
sha256 char(64) NOT NULL,
|
||
|
|
create_time datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||
|
|
INDEX idx_operation(kind,record_id), INDEX idx_draft(owner_id,record_id,create_time)
|
||
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|