Fix download functionality and attachment display
Some checks failed
Deploy to Vercel / deploy (push) Has been cancelled
Deploy to Railway / deploy (push) Has been cancelled

- Fixed MariaDB compatible download API for NAS deployment
- Updated SQLite schema to remove deprecated file_data column
- Enhanced attachment display consistency between admin and public pages
- Resolved category ordering issues in SQLite environment
- Added NAS MariaDB remote connection configuration
- Improved file upload and download functionality for both environments

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-08-22 15:44:54 +09:00
parent 7be1f2ed07
commit bda299a6c3
3 changed files with 69 additions and 70 deletions

View File

@@ -364,8 +364,8 @@ class DatabaseHelper {
return new Promise((resolve, reject) => {
const query = `
INSERT INTO file_attachments (file_id, original_name, file_name, file_path, file_size, mime_type, file_data)
VALUES (?, ?, ?, ?, ?, ?, ?)
INSERT INTO file_attachments (file_id, original_name, file_name, file_path, file_size, mime_type)
VALUES (?, ?, ?, ?, ?, ?)
`;
const params = [
@@ -374,8 +374,7 @@ class DatabaseHelper {
attachmentData.file_name || attachmentData.original_name,
attachmentData.file_path || '',
attachmentData.file_size || 0,
attachmentData.mime_type || '',
attachmentData.file_data || null
attachmentData.mime_type || ''
];
this.db.run(query, params, function(err) {
@@ -410,7 +409,7 @@ class DatabaseHelper {
await this.connect();
return new Promise((resolve, reject) => {
const query = 'SELECT * FROM categories ORDER BY is_default DESC, name ASC';
const query = 'SELECT * FROM categories ORDER BY name ASC';
this.db.all(query, [], (err, rows) => {
if (err) {