File: node_statuses.sql

package info (click to toggle)
goiardi 0.11.10-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,708 kB
  • sloc: sql: 4,994; makefile: 156; sh: 95; python: 30
file content (20 lines) | stat: -rw-r--r-- 531 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
-- Deploy node_statuses
-- requires: nodes

BEGIN;

CREATE TYPE goiardi.status_node AS ENUM ( 'new', 'up', 'down' );
CREATE TABLE goiardi.node_statuses (
	id bigserial,
	node_id bigint not null,
	status goiardi.status_node not null default 'new',
	updated_at timestamp with time zone not null,
	PRIMARY KEY(id),
	FOREIGN KEY(node_id)
		REFERENCES goiardi.nodes(id)
		ON DELETE CASCADE
);
CREATE INDEX node_status_status ON goiardi.node_statuses(status);
CREATE INDEX node_status_time ON goiardi.node_statuses(updated_at);

COMMIT;