Skip to content

Commit

Permalink
mysql: Add new field host_id to table mxq_job
Browse files Browse the repository at this point in the history
  • Loading branch information
mariux committed Sep 24, 2015
1 parent 4f2859e commit 7e1dd39
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
6 changes: 6 additions & 0 deletions mysql/alter_tables_0.15.0.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,9 @@ ALTER TABLE mxq_group
job_max_per_node INT2 UNSIGNED NOT NULL DEFAULT 0
AFTER
job_time;

ALTER TABLE mxq_job
ADD COLUMN
host_id VARCHAR(1023) NOT NULL DEFAULT ""
AFTER
server_id;
1 change: 1 addition & 0 deletions mysql/create_tables.sql
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ CREATE TABLE IF NOT EXISTS mxq_job (
host_submit VARCHAR(64) NOT NULL DEFAULT "localhost",

server_id VARCHAR(1023) NOT NULL DEFAULT "",
host_id VARCHAR(1023) NOT NULL DEFAULT "",

host_hostname VARCHAR(64) NOT NULL DEFAULT "",
host_pid INT4 UNSIGNED NOT NULL DEFAULT 0,
Expand Down
7 changes: 7 additions & 0 deletions mysql/fix_host_id.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
UPDATE mxq_job
SET
host_id = CONCAT(host_hostname, '::', server_id)
WHERE
host_id = ""
AND server_id != ""
AND host_hostname != "";

0 comments on commit 7e1dd39

Please sign in to comment.