This commit is contained in:
2025-10-24 21:06:39 +08:00
parent 45fb8dfeb8
commit 2f56813874
6 changed files with 84 additions and 285 deletions

21
ddl/tmpfiles.sql Normal file
View File

@@ -0,0 +1,21 @@
CREATE TABLE IF NOT EXISTS tmpfiles (
id BIGSERIAL,
file_name VARCHAR(255) NOT NULL,
key VARCHAR(500) NOT NULL UNIQUE,
presigned_url TEXT NOT NULL,
expiration TIMESTAMP WITH TIME ZONE NOT NULL,
created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (id)
);
COMMENT ON TABLE tmpfiles IS 'Temporary files table for storing files with presigned URLs and expiration times';
COMMENT ON COLUMN tmpfiles.id IS 'Unique identifier for the temporary file';
COMMENT ON COLUMN tmpfiles.file_name IS 'Name of the temporary file';
COMMENT ON COLUMN tmpfiles.key IS 'Unique key for the temporary file';
COMMENT ON COLUMN tmpfiles.presigned_url IS 'Presigned URL for accessing the temporary file';
COMMENT ON COLUMN tmpfiles.expiration IS 'Expiration timestamp for the temporary file';
COMMENT ON COLUMN tmpfiles.created_at IS 'Timestamp when the temporary file was created';
CREATE INDEX idx_tmpfiles_expiration ON tmpfiles(expiration);
CREATE INDEX idx_tmpfiles_created_at ON tmpfiles(created_at);