File: shovey.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 (58 lines) | stat: -rw-r--r-- 1,461 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
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
-- Deploy shovey

BEGIN;

CREATE TABLE shoveys (
	id int not null auto_increment,
	run_id varchar(36) not null,
	command text,
	status varchar(30),
	timeout int default 300,
	quorum varchar(25) default "100%",
	created_at datetime not null,
	updated_at datetime not null,
	organization_id int not null default 1,
	primary key(id),
	unique key(run_id),
	index(organization_id),
	index(run_id, organization_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE shovey_runs (
	id int not null auto_increment,
	shovey_uuid varchar(36) not null,
	shovey_id int not null,
	node_name varchar(255) not null,
	status varchar(30),
	ack_time datetime,
	end_time datetime,
	error text,
	exit_status tinyint unsigned,
	PRIMARY KEY(id),
	UNIQUE KEY(shovey_id, node_name),
	FOREIGN KEY (shovey_id)
		REFERENCES shoveys(id)
		ON DELETE RESTRICT,
	INDEX(shovey_uuid),
	INDEX(node_name),
	INDEX(status),
	INDEX(shovey_uuid, node_name)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPRESSED;

CREATE TABLE shovey_run_streams (
	id int not null auto_increment,
	shovey_run_id int not null,
	seq int not null,
	output_type enum('stdout', 'stderr'),
	output mediumtext,
	is_last tinyint default 0,
	created_at datetime not null,
	PRIMARY KEY(id),
	UNIQUE KEY(shovey_run_id, output_type, seq),
	FOREIGN KEY (shovey_run_id)
		REFERENCES shovey_runs(id)
		ON DELETE RESTRICT,
	INDEX(shovey_run_id, output_type)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPRESSED;

COMMIT;