feat: feature voting (PCL-style), poll owner edit/delete, blind polls for all

This commit is contained in:
2026-07-14 01:17:56 +08:00
parent 74974864cd
commit ee2f33c61f
8 changed files with 195 additions and 8 deletions

View File

@@ -200,6 +200,23 @@ async function initSchema(connection) {
INDEX idx_poll (poll_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4`);
await createIfNotExists('feature_items', `CREATE TABLE feature_items (
id INT AUTO_INCREMENT PRIMARY KEY,
title VARCHAR(200) NOT NULL,
description TEXT,
status ENUM('pending','planned','done') NOT NULL DEFAULT 'pending',
created_at DATETIME DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4`);
await createIfNotExists('feature_votes', `CREATE TABLE feature_votes (
id INT AUTO_INCREMENT PRIMARY KEY,
item_id INT NOT NULL,
user_id INT NOT NULL,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
UNIQUE KEY uk_item_user (item_id, user_id),
INDEX idx_item (item_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4`);
await createIfNotExists('audit_logs', `CREATE TABLE audit_logs (
id INT AUTO_INCREMENT PRIMARY KEY,
user_id INT,