-- ------------------------------------------
-- Friendica 2020.09-dev (Red Hot Poker)
--- DB_UPDATE_VERSION 1364
+-- DB_UPDATE_VERSION 1365
-- ------------------------------------------
PRIMARY KEY(`id`),
INDEX `contact-id` (`contact-id`),
INDEX `uid` (`uid`),
+ FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON UPDATE RESTRICT ON DELETE CASCADE,
FOREIGN KEY (`contact-id`) REFERENCES `contact` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='';
PRIMARY KEY(`id`),
INDEX `master-parent-uri-id` (`master-parent-uri-id`),
INDEX `receiver-uid` (`receiver-uid`),
+ INDEX `notify-id` (`notify-id`),
+ FOREIGN KEY (`notify-id`) REFERENCES `notify` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE,
FOREIGN KEY (`receiver-uid`) REFERENCES `user` (`uid`) ON UPDATE RESTRICT ON DELETE CASCADE
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='';
--
CREATE TABLE IF NOT EXISTS `openwebauth-token` (
`id` int unsigned NOT NULL auto_increment COMMENT 'sequential ID',
- `uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id',
+ `uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id - currently unused',
`type` varchar(32) NOT NULL DEFAULT '' COMMENT 'Verify type',
`token` varchar(255) NOT NULL DEFAULT '' COMMENT 'A generated token',
`meta` varchar(255) NOT NULL DEFAULT '' COMMENT '',
`created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'datetime of creation',
PRIMARY KEY(`id`),
- INDEX `uid` (`uid`),
- FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON UPDATE RESTRICT ON DELETE CASCADE
+ INDEX `uid` (`uid`)
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Store OpenWebAuth token to verify contacts';
--
INDEX `uid_wall_received` (`uid`,`wall`,`received`),
INDEX `private_wall_origin_commented` (`private`,`wall`,`origin`,`commented`),
INDEX `uri-id` (`uri-id`),
+ FOREIGN KEY (`iid`) REFERENCES `item` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE,
FOREIGN KEY (`uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Thread related data';
use Friendica\Database\DBA;
if (!defined('DB_UPDATE_VERSION')) {
- define('DB_UPDATE_VERSION', 1364);
+ define('DB_UPDATE_VERSION', 1365);
}
return [
"item" => [
"comment" => "Structure for all posts",
"fields" => [
- "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "relation" => ["thread" => "iid"]],
+ "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"],
"guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this item"],
"uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
"comment" => "",
"fields" => [
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
- "notify-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["notify" => "id"], "comment" => ""],
+ "notify-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["notify" => "id"], "comment" => ""],
"master-parent-item" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => ""],
"master-parent-uri-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Item-uri id of the parent of the related post"],
"parent-item" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
"PRIMARY" => ["id"],
"master-parent-uri-id" => ["master-parent-uri-id"],
"receiver-uid" => ["receiver-uid"],
+ "notify-id" => ["notify-id"],
]
],
"oembed" => [
"comment" => "Store OpenWebAuth token to verify contacts",
"fields" => [
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
- "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
+ "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id - currently unused"],
"type" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => "Verify type"],
"token" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A generated token"],
"meta" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"thread" => [
"comment" => "Thread related data",
"fields" => [
- "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["item" => "id"],
+ "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "foreign" => ["item" => "id"],
"comment" => "sequential ID"],
"uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
"uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],