]> git.mxchange.org Git - friendica.git/commitdiff
New field for groups that are connected with forums
authorMichael <heluecht@pirati.ca>
Wed, 9 Feb 2022 19:44:10 +0000 (19:44 +0000)
committerMichael <heluecht@pirati.ca>
Wed, 9 Feb 2022 19:44:10 +0000 (19:44 +0000)
database.sql
doc/database/db_group.md
static/dbstructure.config.php

index 4237bcce344bd7df88f24db0f12bc1bd99e0244a..ea129109dc366f0672b137081a06f5aa979990f3 100644 (file)
@@ -644,10 +644,13 @@ CREATE TABLE IF NOT EXISTS `group` (
        `uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'Owner User id',
        `visible` boolean NOT NULL DEFAULT '0' COMMENT '1 indicates the member list is not private',
        `deleted` boolean NOT NULL DEFAULT '0' COMMENT '1 indicates the group has been deleted',
+       `cid` int unsigned COMMENT 'Contact id of forum. When this field is filled then the members are synced automatically.',
        `name` varchar(255) NOT NULL DEFAULT '' COMMENT 'human readable name of group',
         PRIMARY KEY(`id`),
         INDEX `uid` (`uid`),
-       FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON UPDATE RESTRICT ON DELETE CASCADE
+        INDEX `cid` (`cid`),
+       FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON UPDATE RESTRICT ON DELETE CASCADE,
+       FOREIGN KEY (`cid`) REFERENCES `contact` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE
 ) DEFAULT COLLATE utf8mb4_general_ci COMMENT='privacy groups, group info';
 
 --
index 1892de3e401afdc71cb30f6aec66dc0d4e66dbd1..ad7fa4a3dde4dab728affad6c133a15b9c587c79 100644 (file)
@@ -6,13 +6,14 @@ privacy groups, group info
 Fields
 ------
 
-| Field   | Description                                | Type               | Null | Key | Default | Extra          |
-| ------- | ------------------------------------------ | ------------------ | ---- | --- | ------- | -------------- |
-| id      | sequential ID                              | int unsigned       | NO   | PRI | NULL    | auto_increment |
-| uid     | Owner User id                              | mediumint unsigned | NO   |     | 0       |                |
-| visible | 1 indicates the member list is not private | boolean            | NO   |     | 0       |                |
-| deleted | 1 indicates the group has been deleted     | boolean            | NO   |     | 0       |                |
-| name    | human readable name of group               | varchar(255)       | NO   |     |         |                |
+| Field   | Description                                                                               | Type               | Null | Key | Default | Extra          |
+| ------- | ----------------------------------------------------------------------------------------- | ------------------ | ---- | --- | ------- | -------------- |
+| id      | sequential ID                                                                             | int unsigned       | NO   | PRI | NULL    | auto_increment |
+| uid     | Owner User id                                                                             | mediumint unsigned | NO   |     | 0       |                |
+| visible | 1 indicates the member list is not private                                                | boolean            | NO   |     | 0       |                |
+| deleted | 1 indicates the group has been deleted                                                    | boolean            | NO   |     | 0       |                |
+| cid     | Contact id of forum. When this field is filled then the members are synced automatically. | int unsigned       | YES  |     | NULL    |                |
+| name    | human readable name of group                                                              | varchar(255)       | NO   |     |         |                |
 
 Indexes
 ------------
@@ -21,6 +22,7 @@ Indexes
 | ------- | ------ |
 | PRIMARY | id     |
 | uid     | uid    |
+| cid     | cid    |
 
 Foreign Keys
 ------------
@@ -28,5 +30,6 @@ Foreign Keys
 | Field | Target Table | Target Field |
 |-------|--------------|--------------|
 | uid | [user](help/database/db_user) | uid |
+| cid | [contact](help/database/db_contact) | id |
 
 Return to [database documentation](help/database)
index 014185c92aa8dc53aabd8f1c2fcbf4c45e01f623..0cf854371862d933d8540dd2f0e9042857bcd820 100644 (file)
@@ -704,11 +704,13 @@ return [
                        "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
                        "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 indicates the member list is not private"],
                        "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 indicates the group has been deleted"],
+                       "cid" => ["type" => "int unsigned", "foreign" => ["contact" => "id"], "comment" => "Contact id of forum. When this field is filled then the members are synced automatically."],
                        "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "human readable name of group"],
                ],
                "indexes" => [
                        "PRIMARY" => ["id"],
                        "uid" => ["uid"],
+                       "cid" => ["cid"],
                ]
        ],
        "group_member" => [