Files
hfb_sys/backend/migrations/000068_file_upload_owners.sql
T
yml2213 0c37c7e659 迁移去重与改号:消除与 main 的 000050-053 撞号
- 删除 dev 的 000051_user_token_version(main 的 000052_user_token_version 已实现同列)
- order_list_least_privilege / file_upload_owners / cleanup_index 改号为 000067-000069
- 000068 改为 CREATE TABLE IF NOT EXISTS、000069 改为条件加索引,兼容已执行旧编号的历史库
2026-09-05 11:54:53 +08:00

17 lines
605 B
SQL

-- +goose Up
-- 私有文件上传归属:在业务记录写入前,仅允许上传者预览自己的临时文件。
CREATE TABLE IF NOT EXISTS 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;