New field for groups that are connected with forums

This commit is contained in:
Michael 2022-02-09 19:44:10 +00:00
parent 6c156e3bc6
commit 85eab6ebee
3 changed files with 16 additions and 8 deletions

View File

@ -644,10 +644,13 @@ CREATE TABLE IF NOT EXISTS `group` (
`uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'Owner User id', `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', `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', `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', `name` varchar(255) NOT NULL DEFAULT '' COMMENT 'human readable name of group',
PRIMARY KEY(`id`), PRIMARY KEY(`id`),
INDEX `uid` (`uid`), 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'; ) DEFAULT COLLATE utf8mb4_general_ci COMMENT='privacy groups, group info';
-- --

View File

@ -7,11 +7,12 @@ Fields
------ ------
| Field | Description | Type | Null | Key | Default | Extra | | Field | Description | Type | Null | Key | Default | Extra |
| ------- | ------------------------------------------ | ------------------ | ---- | --- | ------- | -------------- | | ------- | ----------------------------------------------------------------------------------------- | ------------------ | ---- | --- | ------- | -------------- |
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment | | id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
| uid | Owner User id | mediumint unsigned | NO | | 0 | | | uid | Owner User id | mediumint unsigned | NO | | 0 | |
| visible | 1 indicates the member list is not private | boolean | 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 | | | 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 | | | | | name | human readable name of group | varchar(255) | NO | | | |
Indexes Indexes
@ -21,6 +22,7 @@ Indexes
| ------- | ------ | | ------- | ------ |
| PRIMARY | id | | PRIMARY | id |
| uid | uid | | uid | uid |
| cid | cid |
Foreign Keys Foreign Keys
------------ ------------
@ -28,5 +30,6 @@ Foreign Keys
| Field | Target Table | Target Field | | Field | Target Table | Target Field |
|-------|--------------|--------------| |-------|--------------|--------------|
| uid | [user](help/database/db_user) | uid | | uid | [user](help/database/db_user) | uid |
| cid | [contact](help/database/db_contact) | id |
Return to [database documentation](help/database) Return to [database documentation](help/database)

View File

@ -704,11 +704,13 @@ return [
"uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner User id"], "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"], "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"], "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"], "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "human readable name of group"],
], ],
"indexes" => [ "indexes" => [
"PRIMARY" => ["id"], "PRIMARY" => ["id"],
"uid" => ["uid"], "uid" => ["uid"],
"cid" => ["cid"],
] ]
], ],
"group_member" => [ "group_member" => [