feat(17-02): add gocron dependency, subscribers and scheduled_jobs tables with CRUD
- Add gocron/v2 v2.19.1 as direct dependency - Append subscribers and scheduled_jobs CREATE TABLE to schema.sql - Implement full subscriber CRUD (Add/Remove/List/IsSubscribed) - Implement full scheduled job CRUD (Save/List/Get/Delete/UpdateLastRun/SetEnabled)
This commit is contained in:
@@ -55,3 +55,23 @@ CREATE TABLE IF NOT EXISTS custom_dorks (
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_custom_dorks_source ON custom_dorks(source);
|
||||
CREATE INDEX IF NOT EXISTS idx_custom_dorks_category ON custom_dorks(category);
|
||||
|
||||
-- Phase 17: Telegram bot subscribers for auto-notifications.
|
||||
CREATE TABLE IF NOT EXISTS subscribers (
|
||||
chat_id INTEGER PRIMARY KEY,
|
||||
username TEXT,
|
||||
subscribed_at DATETIME DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
|
||||
-- Phase 17: Cron-based scheduled scan jobs.
|
||||
CREATE TABLE IF NOT EXISTS scheduled_jobs (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
name TEXT UNIQUE NOT NULL,
|
||||
cron_expr TEXT NOT NULL,
|
||||
scan_command TEXT NOT NULL,
|
||||
notify_telegram BOOLEAN DEFAULT FALSE,
|
||||
enabled BOOLEAN DEFAULT TRUE,
|
||||
last_run DATETIME,
|
||||
next_run DATETIME,
|
||||
created_at DATETIME DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user