warden-worker/migrations/0005_add_attachments.sql
qaz741wsd856 73223bfa94 feat: add file attachment support for ciphers
- 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.
2025-12-07 11:13:06 +00:00

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);