-- Additive structure only. Does not rewrite any inventory dates or historical business rows. CREATE TABLE IF NOT EXISTS purchase_acceptance_confirmation ( id bigint NOT NULL AUTO_INCREMENT, batch_id bigint NOT NULL, attachment_id varchar(36) NOT NULL, snapshot_hash char(64) NOT NULL, request_key varchar(100) NOT NULL, owner_id bigint NOT NULL, confirmed_by varchar(64) NOT NULL, confirmed_time datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), PRIMARY KEY(id), UNIQUE KEY uk_purchase_acceptance_request(request_key), KEY idx_purchase_acceptance_batch(batch_id,id), KEY idx_purchase_acceptance_file(attachment_id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;