From d7502848fa3394d682d170656148c013d121321d Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 7 Nov 2021 16:10:47 +0000 Subject: [PATCH 1/2] Updated database documentation --- database.sql | 4 ++-- doc/database.md | 1 - doc/database/db_process.md | 19 ++++++++++--------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/database.sql b/database.sql index 9b19517bb9..7c3b67715d 100644 --- a/database.sql +++ b/database.sql @@ -1316,10 +1316,10 @@ CREATE TABLE IF NOT EXISTS `post-user-notification` ( -- CREATE TABLE IF NOT EXISTS `process` ( `pid` int unsigned NOT NULL COMMENT 'The process ID of the current node', - `hostname` varchar(32) NOT NULL COMMENT 'The hostname of the node', + `hostname` varchar(32) NOT NULL COMMENT 'The hostname of the current node', `command` varbinary(32) NOT NULL DEFAULT '' COMMENT '', `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '', - PRIMARY KEY(`pid`, `hostname`), + PRIMARY KEY(`pid`,`hostname`), INDEX `command` (`command`) ) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Currently running system processes'; diff --git a/doc/database.md b/doc/database.md index bc690c6cd2..628e84e211 100644 --- a/doc/database.md +++ b/doc/database.md @@ -29,7 +29,6 @@ Database Tables | [gserver](help/database/db_gserver) | Global servers | | [gserver-tag](help/database/db_gserver-tag) | Tags that the server has subscribed | | [hook](help/database/db_hook) | addon hook registry | -| [host](help/database/db_host) | Hostname | | [inbox-status](help/database/db_inbox-status) | Status of ActivityPub inboxes | | [intro](help/database/db_intro) | | | [item-uri](help/database/db_item-uri) | URI and GUID for items | diff --git a/doc/database/db_process.md b/doc/database/db_process.md index 062e6ff22c..8ffec57671 100644 --- a/doc/database/db_process.md +++ b/doc/database/db_process.md @@ -6,19 +6,20 @@ Currently running system processes Fields ------ -| Field | Description | Type | Null | Key | Default | Extra | -| ------- | ----------- | ------------- | ---- | --- | ------------------- | ----- | -| pid | | int unsigned | NO | PRI | NULL | | -| command | | varbinary(32) | NO | | | | -| created | | datetime | NO | | 0001-01-01 00:00:00 | | +| Field | Description | Type | Null | Key | Default | Extra | +| -------- | ---------------------------------- | ------------- | ---- | --- | ------------------- | ----- | +| pid | The process ID of the current node | int unsigned | NO | PRI | NULL | | +| hostname | The hostname of the current node | varchar(32) | NO | PRI | NULL | | +| command | | varbinary(32) | NO | | | | +| created | | datetime | NO | | 0001-01-01 00:00:00 | | Indexes ------------ -| Name | Fields | -| ------- | ------- | -| PRIMARY | pid | -| command | command | +| Name | Fields | +| ------- | ------------- | +| PRIMARY | pid, hostname | +| command | command | Return to [database documentation](help/database) From a911e8eefdb755436c951450bc6b61c49b3fa490 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 7 Nov 2021 17:04:02 +0000 Subject: [PATCH 2/2] Changed field description --- database.sql | 4 ++-- doc/database/db_process.md | 12 ++++++------ static/dbstructure.config.php | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/database.sql b/database.sql index 7c3b67715d..fbccddcb28 100644 --- a/database.sql +++ b/database.sql @@ -1315,8 +1315,8 @@ CREATE TABLE IF NOT EXISTS `post-user-notification` ( -- TABLE process -- CREATE TABLE IF NOT EXISTS `process` ( - `pid` int unsigned NOT NULL COMMENT 'The process ID of the current node', - `hostname` varchar(32) NOT NULL COMMENT 'The hostname of the current node', + `pid` int unsigned NOT NULL COMMENT 'The ID of the process', + `hostname` varchar(32) NOT NULL COMMENT 'The name of the host the process is ran on', `command` varbinary(32) NOT NULL DEFAULT '' COMMENT '', `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '', PRIMARY KEY(`pid`,`hostname`), diff --git a/doc/database/db_process.md b/doc/database/db_process.md index 8ffec57671..c0eb75f297 100644 --- a/doc/database/db_process.md +++ b/doc/database/db_process.md @@ -6,12 +6,12 @@ Currently running system processes Fields ------ -| Field | Description | Type | Null | Key | Default | Extra | -| -------- | ---------------------------------- | ------------- | ---- | --- | ------------------- | ----- | -| pid | The process ID of the current node | int unsigned | NO | PRI | NULL | | -| hostname | The hostname of the current node | varchar(32) | NO | PRI | NULL | | -| command | | varbinary(32) | NO | | | | -| created | | datetime | NO | | 0001-01-01 00:00:00 | | +| Field | Description | Type | Null | Key | Default | Extra | +| -------- | ------------------------------------------ | ------------- | ---- | --- | ------------------- | ----- | +| pid | The ID of the process | int unsigned | NO | PRI | NULL | | +| hostname | The name of the host the process is ran on | varchar(32) | NO | PRI | NULL | | +| command | | varbinary(32) | NO | | | | +| created | | datetime | NO | | 0001-01-01 00:00:00 | | Indexes ------------ diff --git a/static/dbstructure.config.php b/static/dbstructure.config.php index 409829acd3..b52f670648 100644 --- a/static/dbstructure.config.php +++ b/static/dbstructure.config.php @@ -1332,8 +1332,8 @@ return [ "process" => [ "comment" => "Currently running system processes", "fields" => [ - "pid" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "comment" => "The process ID of the current node"], - "hostname" => ["type" => "varchar(32)", "not null" => "1", "primary" => "1", "comment" => "The hostname of the current node"], + "pid" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "comment" => "The ID of the process"], + "hostname" => ["type" => "varchar(32)", "not null" => "1", "primary" => "1", "comment" => "The name of the host the process is ran on"], "command" => ["type" => "varbinary(32)", "not null" => "1", "default" => "", "comment" => ""], "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""], ],