Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add missing deleted_at and cleanup fields to agents table #311

Merged
merged 3 commits into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions schema/agents.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,17 @@ table "agents" {
default = sql("now()")
}

column "cleanup" {
null = false
type = boolean
default = false
}

column "deleted_at" {
null = true
type = timestamptz
}

primary_key {
columns = [column.id]
}
Expand Down
6 changes: 5 additions & 1 deletion views/022_agents.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
DROP VIEW IF EXISTS agents_summary;

CREATE OR REPLACE VIEW agents_summary AS
SELECT
agents.*,
Expand Down Expand Up @@ -42,4 +44,6 @@ FROM
playbook_runs
GROUP BY
agent_id
) AS playbook_runs ON playbook_runs.agent_id = agents.id
) AS playbook_runs ON playbook_runs.agent_id = agents.id
WHERE
deleted_at IS NULL;
Loading