stl-storage/schema.sql
kris 3dff6b00d4 Initial commit: STL Storage Application
- Complete web-based STL file storage and 3D viewer
- Express.js backend with SQLite database
- Interactive Three.js 3D viewer with orbit controls
- File upload with drag-and-drop support
- Security features: rate limiting, input validation, helmet
- Container deployment with Docker/Podman
- Production-ready configuration management
- Comprehensive logging and monitoring

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-07 16:18:58 +00:00

25 lines
899 B
SQL

CREATE TABLE IF NOT EXISTS stl_files (
id INTEGER PRIMARY KEY AUTOINCREMENT,
filename VARCHAR(255) NOT NULL,
original_name VARCHAR(255) NOT NULL,
file_path VARCHAR(500) NOT NULL UNIQUE,
file_size INTEGER NOT NULL,
upload_date DATETIME DEFAULT CURRENT_TIMESTAMP,
last_modified DATETIME DEFAULT CURRENT_TIMESTAMP,
description TEXT,
tags VARCHAR(500),
print_settings JSON,
dimensions JSON,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP
);
CREATE INDEX IF NOT EXISTS idx_filename ON stl_files(filename);
CREATE INDEX IF NOT EXISTS idx_upload_date ON stl_files(upload_date);
CREATE INDEX IF NOT EXISTS idx_tags ON stl_files(tags);
CREATE TRIGGER IF NOT EXISTS update_stl_files_timestamp
AFTER UPDATE ON stl_files
BEGIN
UPDATE stl_files SET updated_at = CURRENT_TIMESTAMP WHERE id = NEW.id;
END;