- Implemented functionality to create, upload, download, and delete attachments associated with ciphers. - Introduced a new `attachments` module and updated the database schema to include an `attachments` table. - Enhanced the API routes to handle attachment operations, including legacy support. - Updated the README and configuration files to reflect the new attachment feature and its usage.
15 lines
481 B
SQL
15 lines
481 B
SQL
-- Create attachments table to store metadata for file uploads.
|
|
CREATE TABLE IF NOT EXISTS attachments (
|
|
id TEXT PRIMARY KEY NOT NULL,
|
|
cipher_id TEXT NOT NULL,
|
|
file_name TEXT NOT NULL,
|
|
file_size INTEGER NOT NULL,
|
|
akey TEXT,
|
|
created_at TEXT NOT NULL,
|
|
updated_at TEXT NOT NULL,
|
|
organization_id TEXT,
|
|
FOREIGN KEY (cipher_id) REFERENCES ciphers(id) ON DELETE CASCADE
|
|
);
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_attachments_cipher ON attachments(cipher_id);
|
|
|