Add vw_ednclogs view for easy querying with hostname
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -19,5 +19,21 @@ CREATE TABLE IF NOT EXISTS ednclogs (
|
|||||||
INDEX idx_action (action)
|
INDEX idx_action (action)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||||
|
|
||||||
|
-- View for easy querying (includes hostname from machines)
|
||||||
|
CREATE OR REPLACE VIEW vw_ednclogs AS
|
||||||
|
SELECT
|
||||||
|
l.logid,
|
||||||
|
l.machineid,
|
||||||
|
m.hostname,
|
||||||
|
l.filename,
|
||||||
|
l.action,
|
||||||
|
l.bytes_removed,
|
||||||
|
l.version,
|
||||||
|
l.message,
|
||||||
|
l.created
|
||||||
|
FROM ednclogs l
|
||||||
|
INNER JOIN machines m ON l.machineid = m.machineid;
|
||||||
|
|
||||||
-- Verify
|
-- Verify
|
||||||
DESCRIBE ednclogs;
|
DESCRIBE ednclogs;
|
||||||
|
SELECT 'View created: vw_ednclogs' AS status;
|
||||||
|
|||||||
Reference in New Issue
Block a user