diff options
| author | adamdottv <[email protected]> | 2025-05-09 13:37:13 -0500 |
|---|---|---|
| committer | adamdottv <[email protected]> | 2025-05-09 13:37:13 -0500 |
| commit | f1007771997bd0401516eda87a7e0ac92f269680 (patch) | |
| tree | d26198d031516eaebcc885870b470925492d8775 /internal/db/migrations | |
| parent | f41b7bbd0a0cc731fd7c471b7ee8b26f14a21755 (diff) | |
| download | opencode-f1007771997bd0401516eda87a7e0ac92f269680.tar.gz opencode-f1007771997bd0401516eda87a7e0ac92f269680.zip | |
wip: logging improvements
Diffstat (limited to 'internal/db/migrations')
| -rw-r--r-- | internal/db/migrations/20250508122310_create_logs_table.sql | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/internal/db/migrations/20250508122310_create_logs_table.sql b/internal/db/migrations/20250508122310_create_logs_table.sql new file mode 100644 index 000000000..f4876fbae --- /dev/null +++ b/internal/db/migrations/20250508122310_create_logs_table.sql @@ -0,0 +1,16 @@ +-- +goose Up +CREATE TABLE logs ( + id TEXT PRIMARY KEY, + session_id TEXT REFERENCES sessions(id) ON DELETE CASCADE, + timestamp INTEGER NOT NULL, + level TEXT NOT NULL, + message TEXT NOT NULL, + attributes TEXT, + created_at INTEGER NOT NULL +); + +CREATE INDEX logs_session_id_idx ON logs(session_id); +CREATE INDEX logs_timestamp_idx ON logs(timestamp); + +-- +goose Down +DROP TABLE logs;
\ No newline at end of file |
