]> git.mxchange.org Git - friendica.git/commitdiff
Updated database description
authorMichael <heluecht@pirati.ca>
Mon, 2 May 2022 05:17:42 +0000 (05:17 +0000)
committerMichael <heluecht@pirati.ca>
Mon, 2 May 2022 05:17:42 +0000 (05:17 +0000)
database.sql
doc/database.md
doc/database/db_inbox-status.md
doc/database/db_post-delivery.md [new file with mode: 0644]

index 7a8ee0adb78b587a012e3d5a46af3a0f997a6e9b..58d79fb4bbe31d12f7d003222773f3619fcb8547 100644 (file)
@@ -712,13 +712,16 @@ CREATE TABLE IF NOT EXISTS `hook` (
 --
 CREATE TABLE IF NOT EXISTS `inbox-status` (
        `url` varbinary(255) NOT NULL COMMENT 'URL of the inbox',
+       `uri-id` int unsigned COMMENT 'Item-uri id of inbox url',
        `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'Creation date of this entry',
        `success` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'Date of the last successful delivery',
        `failure` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'Date of the last failed delivery',
        `previous` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'Previous delivery date',
        `archive` boolean NOT NULL DEFAULT '0' COMMENT 'Is the inbox archived?',
        `shared` boolean NOT NULL DEFAULT '0' COMMENT 'Is it a shared inbox?',
-        PRIMARY KEY(`url`)
+        PRIMARY KEY(`url`),
+        INDEX `uri-id` (`uri-id`),
+       FOREIGN KEY (`uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE
 ) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Status of ActivityPub inboxes';
 
 --
@@ -1114,6 +1117,23 @@ CREATE TABLE IF NOT EXISTS `post-content` (
        FOREIGN KEY (`uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE
 ) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Content for all posts';
 
+--
+-- TABLE post-delivery
+--
+CREATE TABLE IF NOT EXISTS `post-delivery` (
+       `uri-id` int unsigned NOT NULL COMMENT 'Id of the item-uri table entry that contains the item uri',
+       `inbox-id` int unsigned NOT NULL COMMENT 'Item-uri id of inbox url',
+       `uid` mediumint unsigned COMMENT 'Delivering user',
+       `created` datetime DEFAULT '0001-01-01 00:00:00' COMMENT '',
+       `command` varbinary(32) COMMENT '',
+        PRIMARY KEY(`uri-id`,`inbox-id`),
+        INDEX `inbox-id_created` (`inbox-id`,`created`),
+        INDEX `uid` (`uid`),
+       FOREIGN KEY (`uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE,
+       FOREIGN KEY (`inbox-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE,
+       FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON UPDATE RESTRICT ON DELETE CASCADE
+) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Status of ActivityPub inboxes';
+
 --
 -- TABLE post-delivery-data
 --
index dff31657fdbd89153b24f721b0d398817bfec8d3..961e8183ab7267c5ecf96d79577f493181c6e503 100644 (file)
@@ -50,6 +50,7 @@ Database Tables
 | [post-category](help/database/db_post-category) | post relation to categories |
 | [post-collection](help/database/db_post-collection) | Collection of posts |
 | [post-content](help/database/db_post-content) | Content for all posts |
+| [post-delivery](help/database/db_post-delivery) | Status of ActivityPub inboxes |
 | [post-delivery-data](help/database/db_post-delivery-data) | Delivery data for items |
 | [post-link](help/database/db_post-link) | Post related external links |
 | [post-media](help/database/db_post-media) | Attached media |
index 3b82cf46a0620521f3c995ebd24c8b0b6447a124..79df149a59c984503edcf84de49830542ea7c228 100644 (file)
@@ -9,6 +9,7 @@ Fields
 | Field    | Description                          | Type           | Null | Key | Default             | Extra |
 | -------- | ------------------------------------ | -------------- | ---- | --- | ------------------- | ----- |
 | url      | URL of the inbox                     | varbinary(255) | NO   | PRI | NULL                |       |
+| uri-id   | Item-uri id of inbox url             | int unsigned   | YES  |     | NULL                |       |
 | created  | Creation date of this entry          | datetime       | NO   |     | 0001-01-01 00:00:00 |       |
 | success  | Date of the last successful delivery | datetime       | NO   |     | 0001-01-01 00:00:00 |       |
 | failure  | Date of the last failed delivery     | datetime       | NO   |     | 0001-01-01 00:00:00 |       |
@@ -22,6 +23,13 @@ Indexes
 | Name    | Fields |
 | ------- | ------ |
 | PRIMARY | url    |
+| uri-id  | uri-id |
 
+Foreign Keys
+------------
+
+| Field | Target Table | Target Field |
+|-------|--------------|--------------|
+| uri-id | [item-uri](help/database/db_item-uri) | id |
 
 Return to [database documentation](help/database)
diff --git a/doc/database/db_post-delivery.md b/doc/database/db_post-delivery.md
new file mode 100644 (file)
index 0000000..1937e05
--- /dev/null
@@ -0,0 +1,35 @@
+Table post-delivery
+===========
+
+Status of ActivityPub inboxes
+
+Fields
+------
+
+| Field    | Description                                               | Type               | Null | Key | Default             | Extra |
+| -------- | --------------------------------------------------------- | ------------------ | ---- | --- | ------------------- | ----- |
+| uri-id   | Id of the item-uri table entry that contains the item uri | int unsigned       | NO   | PRI | NULL                |       |
+| inbox-id | Item-uri id of inbox url                                  | int unsigned       | NO   | PRI | NULL                |       |
+| uid      | Delivering user                                           | mediumint unsigned | YES  |     | NULL                |       |
+| created  |                                                           | datetime           | YES  |     | 0001-01-01 00:00:00 |       |
+| command  |                                                           | varbinary(32)      | YES  |     | NULL                |       |
+
+Indexes
+------------
+
+| Name             | Fields            |
+| ---------------- | ----------------- |
+| PRIMARY          | uri-id, inbox-id  |
+| inbox-id_created | inbox-id, created |
+| uid              | uid               |
+
+Foreign Keys
+------------
+
+| Field | Target Table | Target Field |
+|-------|--------------|--------------|
+| uri-id | [item-uri](help/database/db_item-uri) | id |
+| inbox-id | [item-uri](help/database/db_item-uri) | id |
+| uid | [user](help/database/db_user) | uid |
+
+Return to [database documentation](help/database)