Merge pull request #12003 from annando/linked-posts
Detect linked posts and add them as quote
This commit is contained in:
commit
b33b70f0ab
|
@ -1,6 +1,6 @@
|
||||||
-- ------------------------------------------
|
-- ------------------------------------------
|
||||||
-- Friendica 2022.12-dev (Giant Rhubarb)
|
-- Friendica 2022.12-dev (Giant Rhubarb)
|
||||||
-- DB_UPDATE_VERSION 1485
|
-- DB_UPDATE_VERSION 1486
|
||||||
-- ------------------------------------------
|
-- ------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
@ -1292,6 +1292,7 @@ CREATE TABLE IF NOT EXISTS `post-media` (
|
||||||
`id` int unsigned NOT NULL auto_increment COMMENT 'sequential ID',
|
`id` int unsigned NOT NULL auto_increment COMMENT 'sequential ID',
|
||||||
`uri-id` int unsigned NOT NULL COMMENT 'Id of the item-uri table entry that contains the item uri',
|
`uri-id` int unsigned NOT NULL COMMENT 'Id of the item-uri table entry that contains the item uri',
|
||||||
`url` varbinary(1024) NOT NULL COMMENT 'Media URL',
|
`url` varbinary(1024) NOT NULL COMMENT 'Media URL',
|
||||||
|
`media-uri-id` int unsigned COMMENT 'Id of the item-uri table entry that contains the activities uri-id',
|
||||||
`type` tinyint unsigned NOT NULL DEFAULT 0 COMMENT 'Media type',
|
`type` tinyint unsigned NOT NULL DEFAULT 0 COMMENT 'Media type',
|
||||||
`mimetype` varchar(60) COMMENT '',
|
`mimetype` varchar(60) COMMENT '',
|
||||||
`height` smallint unsigned COMMENT 'Height of the media',
|
`height` smallint unsigned COMMENT 'Height of the media',
|
||||||
|
@ -1311,7 +1312,9 @@ CREATE TABLE IF NOT EXISTS `post-media` (
|
||||||
PRIMARY KEY(`id`),
|
PRIMARY KEY(`id`),
|
||||||
UNIQUE INDEX `uri-id-url` (`uri-id`,`url`(512)),
|
UNIQUE INDEX `uri-id-url` (`uri-id`,`url`(512)),
|
||||||
INDEX `uri-id-id` (`uri-id`,`id`),
|
INDEX `uri-id-id` (`uri-id`,`id`),
|
||||||
FOREIGN KEY (`uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE
|
INDEX `media-uri-id` (`media-uri-id`),
|
||||||
|
FOREIGN KEY (`uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE,
|
||||||
|
FOREIGN KEY (`media-uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE
|
||||||
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Attached media';
|
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Attached media';
|
||||||
|
|
||||||
--
|
--
|
||||||
|
|
|
@ -7,10 +7,11 @@ 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 |
|
||||||
| uri-id | Id of the item-uri table entry that contains the item uri | int unsigned | NO | | NULL | |
|
| uri-id | Id of the item-uri table entry that contains the item uri | int unsigned | NO | | NULL | |
|
||||||
| url | Media URL | varbinary(1024) | NO | | NULL | |
|
| url | Media URL | varbinary(1024) | NO | | NULL | |
|
||||||
|
| media-uri-id | Id of the item-uri table entry that contains the activities uri-id | int unsigned | YES | | NULL | |
|
||||||
| type | Media type | tinyint unsigned | NO | | 0 | |
|
| type | Media type | tinyint unsigned | NO | | 0 | |
|
||||||
| mimetype | | varchar(60) | YES | | NULL | |
|
| mimetype | | varchar(60) | YES | | NULL | |
|
||||||
| height | Height of the media | smallint unsigned | YES | | NULL | |
|
| height | Height of the media | smallint unsigned | YES | | NULL | |
|
||||||
|
@ -32,10 +33,11 @@ Indexes
|
||||||
------------
|
------------
|
||||||
|
|
||||||
| Name | Fields |
|
| Name | Fields |
|
||||||
| ---------- | ------------------------ |
|
| ------------ | ------------------------ |
|
||||||
| PRIMARY | id |
|
| PRIMARY | id |
|
||||||
| uri-id-url | UNIQUE, uri-id, url(512) |
|
| uri-id-url | UNIQUE, uri-id, url(512) |
|
||||||
| uri-id-id | uri-id, id |
|
| uri-id-id | uri-id, id |
|
||||||
|
| media-uri-id | media-uri-id |
|
||||||
|
|
||||||
Foreign Keys
|
Foreign Keys
|
||||||
------------
|
------------
|
||||||
|
@ -43,5 +45,6 @@ Foreign Keys
|
||||||
| Field | Target Table | Target Field |
|
| Field | Target Table | Target Field |
|
||||||
|-------|--------------|--------------|
|
|-------|--------------|--------------|
|
||||||
| uri-id | [item-uri](help/database/db_item-uri) | id |
|
| uri-id | [item-uri](help/database/db_item-uri) | id |
|
||||||
|
| media-uri-id | [item-uri](help/database/db_item-uri) | id |
|
||||||
|
|
||||||
Return to [database documentation](help/database)
|
Return to [database documentation](help/database)
|
||||||
|
|
|
@ -608,9 +608,10 @@ class Item
|
||||||
*
|
*
|
||||||
* @param integer $UriId
|
* @param integer $UriId
|
||||||
* @param integer $uid
|
* @param integer $uid
|
||||||
|
* @param bool $add_media
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function createSharedPostByUriId(int $UriId, int $uid = 0): string
|
public function createSharedPostByUriId(int $UriId, int $uid = 0, bool $add_media = false): string
|
||||||
{
|
{
|
||||||
$fields = ['uri-id', 'uri', 'body', 'title', 'author-name', 'author-link', 'author-avatar', 'guid', 'created', 'plink', 'network'];
|
$fields = ['uri-id', 'uri', 'body', 'title', 'author-name', 'author-link', 'author-avatar', 'guid', 'created', 'plink', 'network'];
|
||||||
$shared_item = Post::selectFirst($fields, ['uri-id' => $UriId, 'uid' => [$uid, 0], 'private' => [ModelItem::PUBLIC, ModelItem::UNLISTED]]);
|
$shared_item = Post::selectFirst($fields, ['uri-id' => $UriId, 'uid' => [$uid, 0], 'private' => [ModelItem::PUBLIC, ModelItem::UNLISTED]]);
|
||||||
|
@ -619,7 +620,7 @@ class Item
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->createSharedBlockByArray($shared_item);
|
return $this->createSharedBlockByArray($shared_item, $add_media);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -627,9 +628,10 @@ class Item
|
||||||
*
|
*
|
||||||
* @param string $guid
|
* @param string $guid
|
||||||
* @param integer $uid
|
* @param integer $uid
|
||||||
|
* @param bool $add_media
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function createSharedPostByGuid(string $guid, int $uid = 0, string $host = ''): string
|
public function createSharedPostByGuid(string $guid, int $uid = 0, string $host = '', bool $add_media = false): string
|
||||||
{
|
{
|
||||||
$fields = ['uri-id', 'uri', 'body', 'title', 'author-name', 'author-link', 'author-avatar', 'guid', 'created', 'plink', 'network'];
|
$fields = ['uri-id', 'uri', 'body', 'title', 'author-name', 'author-link', 'author-avatar', 'guid', 'created', 'plink', 'network'];
|
||||||
$shared_item = Post::selectFirst($fields, ['guid' => $guid, 'uid' => [$uid, 0], 'private' => [ModelItem::PUBLIC, ModelItem::UNLISTED]]);
|
$shared_item = Post::selectFirst($fields, ['guid' => $guid, 'uid' => [$uid, 0], 'private' => [ModelItem::PUBLIC, ModelItem::UNLISTED]]);
|
||||||
|
@ -646,7 +648,7 @@ class Item
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->createSharedBlockByArray($shared_item);
|
return $this->createSharedBlockByArray($shared_item, $add_media);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -678,7 +680,7 @@ class Item
|
||||||
|
|
||||||
// If it is a reshared post then reformat it to avoid display problems with two share elements
|
// If it is a reshared post then reformat it to avoid display problems with two share elements
|
||||||
if (Diaspora::isReshare($item['body'], false)) {
|
if (Diaspora::isReshare($item['body'], false)) {
|
||||||
if (!empty($shared['guid']) && ($encaspulated_share = self::createSharedPostByGuid($shared['guid']))) {
|
if (!empty($shared['guid']) && ($encaspulated_share = self::createSharedPostByGuid($shared['guid'], 0, '', $add_media))) {
|
||||||
$item['body'] = preg_replace("/\[share.*?\](.*)\[\/share\]/ism", $encaspulated_share, $item['body']);
|
$item['body'] = preg_replace("/\[share.*?\](.*)\[\/share\]/ism", $encaspulated_share, $item['body']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2946,17 +2946,44 @@ class Item
|
||||||
$body = $item['body'] ?? '';
|
$body = $item['body'] ?? '';
|
||||||
$shared = BBCode::fetchShareAttributes($body);
|
$shared = BBCode::fetchShareAttributes($body);
|
||||||
if (!empty($shared['guid'])) {
|
if (!empty($shared['guid'])) {
|
||||||
$shared_item = Post::selectFirst(['uri-id', 'plink', 'has-media'], ['guid' => $shared['guid']]);
|
$shared_item = Post::selectFirst(['uri-id', 'guid', 'plink', 'has-media'], ['guid' => $shared['guid'], 'uid' => [$item['uid'], 0]]);
|
||||||
$shared_uri_id = $shared_item['uri-id'] ?? 0;
|
}
|
||||||
$shared_links = [strtolower($shared_item['plink'] ?? '')];
|
|
||||||
$shared_attachments = Post\Media::splitAttachments($shared_uri_id, $shared['guid'], [], $shared_item['has-media'] ?? false);
|
$fields = ['uri-id', 'uri', 'body', 'title', 'author-name', 'author-link', 'author-avatar', 'guid', 'created', 'plink', 'network', 'has-media'];
|
||||||
|
|
||||||
|
$shared_uri_id = 0;
|
||||||
|
$shared_links = [];
|
||||||
|
|
||||||
|
if (empty($shared_item['uri-id']) && !empty($item['quote-uri-id'])) {
|
||||||
|
$shared_item = Post::selectFirst($fields, ['uri-id' => $item['quote-uri-id']]);
|
||||||
|
$quote_uri_id = $item['quote-uri-id'] ?? 0;
|
||||||
|
$shared_links[] = strtolower($item['quote-uri']);
|
||||||
|
} elseif (empty($shared_item['uri-id']) && empty($item['quote-uri-id'])) {
|
||||||
|
$media = Post\Media::getByURIId($item['uri-id'], [Post\Media::ACTIVITY]);
|
||||||
|
if (!empty($media)) {
|
||||||
|
$shared_item = Post::selectFirst($fields, ['plink' => $media[0]['url'], 'uid' => [$item['uid'], 0]]);
|
||||||
|
|
||||||
|
if (empty($shared_item['uri-id'])) {
|
||||||
|
$shared_item = Post::selectFirst($fields, ['uri' => $media[0]['url'], 'uid' => [$item['uid'], 0]]);
|
||||||
|
$shared_links[] = strtolower($media[0]['url']);
|
||||||
|
}
|
||||||
|
|
||||||
|
$quote_uri_id = $shared_item['uri-id'] ?? 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($quote_uri_id)) {
|
||||||
|
$item['body'] .= "\n" . DI::contentItem()->createSharedBlockByArray($shared_item);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($shared_item['uri-id'])) {
|
||||||
|
$shared_uri_id = $shared_item['uri-id'];
|
||||||
|
$shared_links[] = strtolower($shared_item['plink']);
|
||||||
|
$shared_attachments = Post\Media::splitAttachments($shared_uri_id, $shared_item['guid'], [], $shared_item['has-media']);
|
||||||
$shared_links = array_merge($shared_links, array_column($shared_attachments['visual'], 'url'));
|
$shared_links = array_merge($shared_links, array_column($shared_attachments['visual'], 'url'));
|
||||||
$shared_links = array_merge($shared_links, array_column($shared_attachments['link'], 'url'));
|
$shared_links = array_merge($shared_links, array_column($shared_attachments['link'], 'url'));
|
||||||
$shared_links = array_merge($shared_links, array_column($shared_attachments['additional'], 'url'));
|
$shared_links = array_merge($shared_links, array_column($shared_attachments['additional'], 'url'));
|
||||||
$item['body'] = self::replaceVisualAttachments($shared_attachments, $item['body']);
|
$item['body'] = self::replaceVisualAttachments($shared_attachments, $item['body']);
|
||||||
} else {
|
|
||||||
$shared_uri_id = 0;
|
|
||||||
$shared_links = [];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$attachments = Post\Media::splitAttachments($item['uri-id'], $item['guid'] ?? '', $shared_links, $item['has-media'] ?? false);
|
$attachments = Post\Media::splitAttachments($item['uri-id'], $item['guid'] ?? '', $shared_links, $item['has-media'] ?? false);
|
||||||
|
@ -3278,7 +3305,7 @@ class Item
|
||||||
}
|
}
|
||||||
DI::profiler()->stopRecording();
|
DI::profiler()->stopRecording();
|
||||||
|
|
||||||
if (isset($data['url']) && !in_array($data['url'], $ignore_links)) {
|
if (isset($data['url']) && !in_array(strtolower($data['url']), $ignore_links)) {
|
||||||
if (!empty($data['description']) || !empty($data['image']) || !empty($data['preview'])) {
|
if (!empty($data['description']) || !empty($data['image']) || !empty($data['preview'])) {
|
||||||
$parts = parse_url($data['url']);
|
$parts = parse_url($data['url']);
|
||||||
if (!empty($parts['scheme']) && !empty($parts['host'])) {
|
if (!empty($parts['scheme']) && !empty($parts['host'])) {
|
||||||
|
|
|
@ -23,10 +23,12 @@ namespace Friendica\Model\Post;
|
||||||
|
|
||||||
use Friendica\Content\Text\BBCode;
|
use Friendica\Content\Text\BBCode;
|
||||||
use Friendica\Core\Logger;
|
use Friendica\Core\Logger;
|
||||||
|
use Friendica\Core\Protocol;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\Database;
|
use Friendica\Database\Database;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
|
use Friendica\Model\Contact;
|
||||||
use Friendica\Model\Item;
|
use Friendica\Model\Item;
|
||||||
use Friendica\Model\Photo;
|
use Friendica\Model\Photo;
|
||||||
use Friendica\Model\Post;
|
use Friendica\Model\Post;
|
||||||
|
@ -56,6 +58,7 @@ class Media
|
||||||
const HTML = 17;
|
const HTML = 17;
|
||||||
const XML = 18;
|
const XML = 18;
|
||||||
const PLAIN = 19;
|
const PLAIN = 19;
|
||||||
|
const ACTIVITY = 20;
|
||||||
const DOCUMENT = 128;
|
const DOCUMENT = 128;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -215,6 +218,10 @@ class Media
|
||||||
$media = self::addType($media);
|
$media = self::addType($media);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (in_array($media['type'], [self::TEXT, self::APPLICATION, self::HTML, self::XML, self::PLAIN])) {
|
||||||
|
$media = self::addActivity($media);
|
||||||
|
}
|
||||||
|
|
||||||
if ($media['type'] == self::HTML) {
|
if ($media['type'] == self::HTML) {
|
||||||
$data = ParseUrl::getSiteinfoCached($media['url'], false);
|
$data = ParseUrl::getSiteinfoCached($media['url'], false);
|
||||||
$media['preview'] = $data['images'][0]['src'] ?? null;
|
$media['preview'] = $data['images'][0]['src'] ?? null;
|
||||||
|
@ -232,6 +239,65 @@ class Media
|
||||||
return $media;
|
return $media;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adds the activity type if the media entry is linked to an activity
|
||||||
|
*
|
||||||
|
* @param array $media
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
private static function addActivity(array $media): array
|
||||||
|
{
|
||||||
|
$id = Item::fetchByLink($media['url']);
|
||||||
|
if (empty($id)) {
|
||||||
|
return $media;
|
||||||
|
}
|
||||||
|
|
||||||
|
$item = Post::selectFirst([], ['id' => $id, 'network' => Protocol::FEDERATED]);
|
||||||
|
if (empty($item['id'])) {
|
||||||
|
Logger::debug('Not a federated activity', ['id' => $id, 'uri-id' => $media['uri-id'], 'url' => $media['url']]);
|
||||||
|
return $media;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($item['plink']) && Strings::compareLink($item['plink'], $media['url']) &&
|
||||||
|
parse_url($item['plink'], PHP_URL_HOST) != parse_url($item['uri'], PHP_URL_HOST)) {
|
||||||
|
Logger::debug('Not a link to an activity', ['uri-id' => $media['uri-id'], 'url' => $media['url'], 'plink' => $item['plink'], 'uri' => $item['uri']]);
|
||||||
|
return $media;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (in_array($item['network'], [Protocol::ACTIVITYPUB, Protocol::DFRN])) {
|
||||||
|
$media['mimetype'] = 'application/activity+json';
|
||||||
|
} elseif ($item['network'] == Protocol::DIASPORA) {
|
||||||
|
$media['mimetype'] = 'application/xml';
|
||||||
|
} else {
|
||||||
|
$media['mimetype'] = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
$contact = Contact::getById($item['author-id'], ['avatar', 'gsid']);
|
||||||
|
if (!empty($contact['gsid'])) {
|
||||||
|
$gserver = DBA::selectFirst('gserver', ['url', 'site_name'], ['id' => $contact['gsid']]);
|
||||||
|
}
|
||||||
|
|
||||||
|
$media['type'] = self::ACTIVITY;
|
||||||
|
$media['media-uri-id'] = $item['uri-id'];
|
||||||
|
$media['height'] = null;
|
||||||
|
$media['width'] = null;
|
||||||
|
$media['size'] = null;
|
||||||
|
$media['preview'] = null;
|
||||||
|
$media['preview-height'] = null;
|
||||||
|
$media['preview-width'] = null;
|
||||||
|
$media['description'] = $item['body'];
|
||||||
|
$media['name'] = $item['title'];
|
||||||
|
$media['author-url'] = $item['author-link'];
|
||||||
|
$media['author-name'] = $item['author-name'];
|
||||||
|
$media['author-image'] = $contact['avatar'] ?? $item['author-avatar'];
|
||||||
|
$media['publisher-url'] = $gserver['url'] ?? null;
|
||||||
|
$media['publisher-name'] = $gserver['site_name'] ?? null;
|
||||||
|
$media['publisher-image'] = null;
|
||||||
|
|
||||||
|
Logger::debug('Activity detected', ['uri-id' => $media['uri-id'], 'url' => $media['url'], 'plink' => $item['plink'], 'uri' => $item['uri']]);
|
||||||
|
return $media;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fetch media data from local resources
|
* Fetch media data from local resources
|
||||||
* @param array $media
|
* @param array $media
|
||||||
|
|
|
@ -170,7 +170,7 @@ class Processor
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stire attachment data
|
* Store attachment data
|
||||||
*
|
*
|
||||||
* @param array $activity
|
* @param array $activity
|
||||||
* @param array $item
|
* @param array $item
|
||||||
|
@ -187,7 +187,7 @@ class Processor
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Store attachment data
|
* Store question data
|
||||||
*
|
*
|
||||||
* @param array $activity
|
* @param array $activity
|
||||||
* @param array $item
|
* @param array $item
|
||||||
|
|
|
@ -1674,14 +1674,9 @@ class Transmitter
|
||||||
}
|
}
|
||||||
$data['quoteUrl'] = $item['quote-uri'];
|
$data['quoteUrl'] = $item['quote-uri'];
|
||||||
} elseif (!empty($item['quote-uri']) && !Diaspora::isReshare($body, false)) {
|
} elseif (!empty($item['quote-uri']) && !Diaspora::isReshare($body, false)) {
|
||||||
$fields = ['uri-id', 'uri', 'body', 'title', 'author-name', 'author-link', 'author-avatar', 'guid', 'created', 'plink', 'network'];
|
$body .= "\n" . DI::contentItem()->createSharedPostByUriId($item['quote-uri-id'], $item['uid'], true);
|
||||||
$shared_item = Post::selectFirst($fields, ['uri-id' => $item['quote-uri-id']]);
|
|
||||||
if (!empty($shared_item['uri-id'])) {
|
|
||||||
$shared_item['body'] = Post\Media::addAttachmentsToBody($shared_item['uri-id'], $shared_item['body']);
|
|
||||||
$body .= "\n" . DI::contentItem()->createSharedBlockByArray($shared_item);
|
|
||||||
$item['body'] = Item::improveSharedDataInBody($item, true);
|
$item['body'] = Item::improveSharedDataInBody($item, true);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
$data['content'] = BBCode::convertForUriId($item['uri-id'], $body, BBCode::ACTIVITYPUB);
|
$data['content'] = BBCode::convertForUriId($item['uri-id'], $body, BBCode::ACTIVITYPUB);
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,7 +55,7 @@
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
|
|
||||||
if (!defined('DB_UPDATE_VERSION')) {
|
if (!defined('DB_UPDATE_VERSION')) {
|
||||||
define('DB_UPDATE_VERSION', 1485);
|
define('DB_UPDATE_VERSION', 1486);
|
||||||
}
|
}
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
@ -1321,6 +1321,7 @@ return [
|
||||||
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
|
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
|
||||||
"uri-id" => ["type" => "int unsigned", "not null" => "1", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
|
"uri-id" => ["type" => "int unsigned", "not null" => "1", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
|
||||||
"url" => ["type" => "varbinary(1024)", "not null" => "1", "comment" => "Media URL"],
|
"url" => ["type" => "varbinary(1024)", "not null" => "1", "comment" => "Media URL"],
|
||||||
|
"media-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the activities uri-id"],
|
||||||
"type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Media type"],
|
"type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Media type"],
|
||||||
"mimetype" => ["type" => "varchar(60)", "comment" => ""],
|
"mimetype" => ["type" => "varchar(60)", "comment" => ""],
|
||||||
"height" => ["type" => "smallint unsigned", "comment" => "Height of the media"],
|
"height" => ["type" => "smallint unsigned", "comment" => "Height of the media"],
|
||||||
|
@ -1342,6 +1343,7 @@ return [
|
||||||
"PRIMARY" => ["id"],
|
"PRIMARY" => ["id"],
|
||||||
"uri-id-url" => ["UNIQUE", "uri-id", "url(512)"],
|
"uri-id-url" => ["UNIQUE", "uri-id", "url(512)"],
|
||||||
"uri-id-id" => ["uri-id", "id"],
|
"uri-id-id" => ["uri-id", "id"],
|
||||||
|
"media-uri-id" => ["media-uri-id"],
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
"post-question" => [
|
"post-question" => [
|
||||||
|
|
Loading…
Reference in New Issue
Block a user