-- +goose Up

-- 私有文件上传归属：在业务记录写入前，仅允许上传者预览自己的临时文件。
CREATE TABLE file_upload_owners (
  id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
  user_id BIGINT UNSIGNED NOT NULL,
  object_key VARCHAR(512) NOT NULL,
  created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (id),
  UNIQUE KEY uk_file_upload_owners_object_key (object_key),
  KEY idx_file_upload_owners_user_id (user_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='私有文件上传归属';

-- +goose Down

DROP TABLE IF EXISTS file_upload_owners;
