Store the tag type for the post targets

This commit is contained in:
Michael 2022-04-23 11:39:19 +00:00
commit 060597f619
8 changed files with 96 additions and 24 deletions

View file

@ -55,7 +55,7 @@
use Friendica\Database\DBA;
if (!defined('DB_UPDATE_VERSION')) {
define('DB_UPDATE_VERSION', 1458);
define('DB_UPDATE_VERSION', 1459);
}
return [
@ -289,7 +289,8 @@ return [
"fields" => [
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
"name" => ["type" => "varchar(96)", "not null" => "1", "default" => "", "comment" => ""],
"url" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""]
"url" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""],
"type" => ["type" => "tinyint unsigned", "comment" => "Type of the tag (Unknown, Collection or Account)"],
],
"indexes" => [
"PRIMARY" => ["id"],

View file

@ -664,6 +664,7 @@
"cid" => ["post-tag", "cid"],
"name" => "CASE `cid` WHEN 0 THEN `tag`.`name` ELSE `contact`.`name` END",
"url" => "CASE `cid` WHEN 0 THEN `tag`.`url` ELSE `contact`.`url` END",
"tag-type" => "CASE `cid` WHEN 0 THEN `tag`.`type` ELSE 1 END",
],
"query" => "FROM `post-tag`
LEFT JOIN `tag` ON `post-tag`.`tid` = `tag`.`id`