diff options
29 files changed, 1257 insertions, 2362 deletions
diff --git a/appinfo/info.xml b/appinfo/info.xml index 9f1468c9..482fc6cc 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -18,7 +18,7 @@ **🕸 Open standards:** We use the established ActivityPub standard! ]]></description> - <version>0.2.0-dev01</version> + <version>0.2.0-dev02</version> <licence>agpl</licence> <author mail="maxence@artificial-owl.com">Maxence Lange</author> <author mail="jus@bitgrid.net">Julius Härtl</author> diff --git a/lib/Db/ActorsRequestBuilder.php b/lib/Db/ActorsRequestBuilder.php index 5263c6e3..b8aafb6c 100644 --- a/lib/Db/ActorsRequestBuilder.php +++ b/lib/Db/ActorsRequestBuilder.php @@ -48,7 +48,7 @@ class ActorsRequestBuilder extends CoreRequestBuilder { */ protected function getActorsInsertSql(): IQueryBuilder { $qb = $this->dbConnection->getQueryBuilder(); - $qb->insert(self::TABLE_SERVER_ACTORS); + $qb->insert(self::TABLE_ACTORS); return $qb; } @@ -61,7 +61,7 @@ class ActorsRequestBuilder extends CoreRequestBuilder { */ protected function getActorsUpdateSql(): IQueryBuilder { $qb = $this->dbConnection->getQueryBuilder(); - $qb->update(self::TABLE_SERVER_ACTORS); + $qb->update(self::TABLE_ACTORS); return $qb; } @@ -80,7 +80,7 @@ class ActorsRequestBuilder extends CoreRequestBuilder { 'sa.id', 'sa.user_id', 'sa.preferred_username', 'sa.name', 'sa.summary', 'sa.public_key', 'sa.avatar_version', 'sa.private_key', 'sa.creation' ) - ->from(self::TABLE_SERVER_ACTORS, 'sa'); + ->from(self::TABLE_ACTORS, 'sa'); $this->defaultSelectAlias = 'sa'; @@ -95,7 +95,7 @@ class ActorsRequestBuilder extends CoreRequestBuilder { */ protected function getActorsDeleteSql(): IQueryBuilder { $qb = $this->dbConnection->getQueryBuilder(); - $qb->delete(self::TABLE_SERVER_ACTORS); + $qb->delete(self::TABLE_ACTORS); return $qb; } diff --git a/lib/Db/CacheDocumentsRequest.php b/lib/Db/CacheDocumentsRequest.php index b095499a..de904d8b 100644 --- a/lib/Db/CacheDocumentsRequest.php +++ b/lib/Db/CacheDocumentsRequest.php @@ -75,7 +75,7 @@ class CacheDocumentsRequest extends CacheDocumentsRequestBuilder { * @param Document $document */ public function update(Document $document) { - $qb = $this->getCacheDocumentsInsertSql(); + $qb = $this->getCacheDocumentsUpdateSql(); $qb->set('type', $qb->createNamedParameter($document->getType())) ->set('url', $qb->createNamedParameter($document->getUrl())) ->set('media_type', $qb->createNamedParameter($document->getMediaType())) @@ -88,6 +88,8 @@ class CacheDocumentsRequest extends CacheDocumentsRequestBuilder { 'creation', $qb->createNamedParameter(new DateTime('now'), IQueryBuilder::PARAM_DATE) ); + + $this->limitToIdString($qb, $document->getId()); $qb->execute(); } diff --git a/lib/Db/CoreRequestBuilder.php b/lib/Db/CoreRequestBuilder.php index 2672c562..6bfbd2a4 100644 --- a/lib/Db/CoreRequestBuilder.php +++ b/lib/Db/CoreRequestBuilder.php @@ -55,18 +55,31 @@ use OCP\IDBConnection; class CoreRequestBuilder { - const TABLE_REQUEST_QUEUE = 'social_request_queue'; +// const TABLE_REQUEST_QUEUE = 'social_request_queue'; +// +// const TABLE_SERVER_ACTORS = 'social_server_actors'; +// const TABLE_SERVER_NOTES = 'social_server_notes'; +// const TABLE_SERVER_HASHTAGS = 'social_server_hashtags'; +// const TABLE_SERVER_FOLLOWS = 'social_server_follows'; +// +// const TABLE_CACHE_ACTORS = 'social_cache_actors'; +// const TABLE_CACHE_DOCUMENTS = 'social_cache_documents'; +// +// const TABLE_QUEUE_STREAM = 'social_queue_stream'; +// const TABLE_STREAM_ACTIONS = 'social_stream_actions'; - const TABLE_SERVER_ACTORS = 'social_server_actors'; - const TABLE_SERVER_NOTES = 'social_server_notes'; - const TABLE_SERVER_HASHTAGS = 'social_server_hashtags'; - const TABLE_SERVER_FOLLOWS = 'social_server_follows'; + const TABLE_REQUEST_QUEUE = 'social_a2_request_queue'; - const TABLE_CACHE_ACTORS = 'social_cache_actors'; - const TABLE_CACHE_DOCUMENTS = 'social_cache_documents'; + const TABLE_ACTORS = 'social_a2_actors'; + const TABLE_STREAMS = 'social_a2_stream'; + const TABLE_HASHTAGS = 'social_a2_hashtags'; + const TABLE_FOLLOWS = 'social_a2_follows'; - const TABLE_QUEUE_STREAM = 'social_queue_stream'; - const TABLE_STREAM_ACTIONS = 'social_stream_actions'; + const TABLE_CACHE_ACTORS = 'social_a2_cache_actors'; + const TABLE_CACHE_DOCUMENTS = 'social_a2_cache_documts'; + + const TABLE_STREAM_QUEUE = 'social_a2_stream_queue'; + const TABLE_STREAM_ACTIONS = 'social_a2_stream_action'; /** @var IDBConnection */ @@ -869,7 +882,7 @@ class CoreRequestBuilder { ->selectAlias($prefix . '_f.follow_id', $prefix . '_follow_id') ->selectAlias($prefix . '_f.creation', $prefix . '_creation') ->leftJoin( - $this->defaultSelectAlias, CoreRequestBuilder::TABLE_SERVER_FOLLOWS, $prefix . '_f', + $this->defaultSelectAlias, CoreRequestBuilder::TABLE_FOLLOWS, $prefix . '_f', $andX ); } @@ -949,9 +962,9 @@ class CoreRequestBuilder { public function emptyAll() { $tables = [ self::TABLE_REQUEST_QUEUE, - self::TABLE_SERVER_ACTORS, - self::TABLE_SERVER_NOTES, - self::TABLE_SERVER_FOLLOWS, + self::TABLE_ACTORS, + self::TABLE_STREAMS, + self::TABLE_FOLLOWS, self::TABLE_CACHE_ACTORS, self::TABLE_CACHE_DOCUMENTS ]; diff --git a/lib/Db/FollowsRequestBuilder.php b/lib/Db/FollowsRequestBuilder.php index ab2729fb..9d08dfbf 100644 --- a/lib/Db/FollowsRequestBuilder.php +++ b/lib/Db/FollowsRequestBuilder.php @@ -55,7 +55,7 @@ class FollowsRequestBuilder extends CoreRequestBuilder { */ protected function getFollowsInsertSql(): IQueryBuilder { $qb = $this->dbConnection->getQueryBuilder(); - $qb->insert(self::TABLE_SERVER_FOLLOWS); + $qb->insert(self::TABLE_FOLLOWS); return $qb; } @@ -68,7 +68,7 @@ class FollowsRequestBuilder extends CoreRequestBuilder { */ protected function getFollowsUpdateSql(): IQueryBuilder { $qb = $this->dbConnection->getQueryBuilder(); - $qb->update(self::TABLE_SERVER_FOLLOWS); + $qb->update(self::TABLE_FOLLOWS); return $qb; } @@ -86,7 +86,7 @@ class FollowsRequestBuilder extends CoreRequestBuilder { $qb->select( 'f.id', 'f.type', 'f.actor_id', 'f.object_id', 'f.follow_id', 'f.accepted', 'f.creation' ) - ->from(self::TABLE_SERVER_FOLLOWS, 'f'); + ->from(self::TABLE_FOLLOWS, 'f'); $this->defaultSelectAlias = 'f'; @@ -102,7 +102,7 @@ class FollowsRequestBuilder extends CoreRequestBuilder { protected function countFollowsSelectSql(): IQueryBuilder { $qb = $this->dbConnection->getQueryBuilder(); $qb->selectAlias($qb->createFunction('COUNT(*)'), 'count') - ->from(self::TABLE_SERVER_FOLLOWS, 'f'); + ->from(self::TABLE_FOLLOWS, 'f'); $this->defaultSelectAlias = 'f'; @@ -117,7 +117,7 @@ class FollowsRequestBuilder extends CoreRequestBuilder { */ protected function getFollowsDeleteSql(): IQueryBuilder { $qb = $this->dbConnection->getQueryBuilder(); - $qb->delete(self::TABLE_SERVER_FOLLOWS); + $qb->delete(self::TABLE_FOLLOWS); return $qb; } diff --git a/lib/Db/HashtagsRequestBuilder.php b/lib/Db/HashtagsRequestBuilder.php index 2297d280..9f8922d4 100644 --- a/lib/Db/HashtagsRequestBuilder.php +++ b/lib/Db/HashtagsRequestBuilder.php @@ -53,7 +53,7 @@ class HashtagsRequestBuilder extends CoreRequestBuilder { */ protected function getHashtagsInsertSql(): IQueryBuilder { $qb = $this->dbConnection->getQueryBuilder(); - $qb->insert(self::TABLE_SERVER_HASHTAGS); + $qb->insert(self::TABLE_HASHTAGS); return $qb; } @@ -66,7 +66,7 @@ class HashtagsRequestBuilder extends CoreRequestBuilder { */ protected function getHashtagsUpdateSql(): IQueryBuilder { $qb = $this->dbConnection->getQueryBuilder(); - $qb->update(self::TABLE_SERVER_HASHTAGS); + $qb->update(self::TABLE_HASHTAGS); return $qb; } @@ -82,7 +82,7 @@ class HashtagsRequestBuilder extends CoreRequestBuilder { /** @noinspection PhpMethodParametersCountMismatchInspection */ $qb->select('h.hashtag', 'h.trend') - ->from(self::TABLE_SERVER_HASHTAGS, 'h'); + ->from(self::TABLE_HASHTAGS, 'h'); $this->defaultSelectAlias = 'h'; @@ -97,7 +97,7 @@ class HashtagsRequestBuilder extends CoreRequestBuilder { */ protected function getHashtagsDeleteSql(): IQueryBuilder { $qb = $this->dbConnection->getQueryBuilder(); - $qb->delete(self::TABLE_SERVER_HASHTAGS); + $qb->delete(self::TABLE_HASHTAGS); return $qb; } diff --git a/lib/Db/NotesRequest.php b/lib/Db/NotesRequest.php index 2e931526..5bbf2478 100644 --- a/lib/Db/NotesRequest.php +++ b/lib/Db/NotesRequest.php @@ -467,7 +467,7 @@ class NotesRequest extends NotesRequestBuilder { $on = $this->exprJoinFollowing($qb, $actor); $on->add($this->exprLimitToRecipient($qb, ACore::CONTEXT_PUBLIC, false)); $on->add($this->exprLimitToRecipient($qb, $actor->getId(), true)); - $qb->join($this->defaultSelectAlias, CoreRequestBuilder::TABLE_SERVER_FOLLOWS, 'f', $on); + $qb->join($this->defaultSelectAlias, CoreRequestBuilder::TABLE_FOLLOWS, 'f', $on); $qb->andWhere($this->exprValueWithinJsonFormat($qb, 'hashtags', '' . $hashtag)); diff --git a/lib/Db/NotesRequestBuilder.php b/lib/Db/NotesRequestBuilder.php index 8caa7846..19334e99 100644 --- a/lib/Db/NotesRequestBuilder.php +++ b/lib/Db/NotesRequestBuilder.php @@ -59,7 +59,7 @@ class NotesRequestBuilder extends CoreRequestBuilder { */ protected function getNotesInsertSql(): IQueryBuilder { $qb = $this->dbConnection->getQueryBuilder(); - $qb->insert(self::TABLE_SERVER_NOTES); + $qb->insert(self::TABLE_STREAMS); return $qb; } @@ -72,7 +72,7 @@ class NotesRequestBuilder extends CoreRequestBuilder { */ protected function getNotesUpdateSql(): IQueryBuilder { $qb = $this->dbConnection->getQueryBuilder(); - $qb->update(self::TABLE_SERVER_NOTES); + $qb->update(self::TABLE_STREAMS); return $qb; } @@ -95,7 +95,7 @@ class NotesRequestBuilder extends CoreRequestBuilder { 'sn.attributed_to', 'sn.in_reply_to', 'sn.source', 'sn.local', 'sn.instances', 'sn.creation' ) - ->from(self::TABLE_SERVER_NOTES, 'sn'); + ->from(self::TABLE_STREAMS, 'sn'); $this->defaultSelectAlias = 'sn'; @@ -111,7 +111,7 @@ class NotesRequestBuilder extends CoreRequestBuilder { protected function countNotesSelectSql(): IQueryBuilder { $qb = $this->dbConnection->getQueryBuilder(); $qb->selectAlias($qb->createFunction('COUNT(*)'), 'count') - ->from(self::TABLE_SERVER_NOTES, 'sn'); + ->from(self::TABLE_STREAMS, 'sn'); $this->defaultSelectAlias = 'sn'; @@ -126,7 +126,7 @@ class NotesRequestBuilder extends CoreRequestBuilder { */ protected function getNotesDeleteSql(): IQueryBuilder { $qb = $this->dbConnection->getQueryBuilder(); - $qb->delete(self::TABLE_SERVER_NOTES); + $qb->delete(self::TABLE_STREAMS); return $qb; } @@ -141,7 +141,7 @@ class NotesRequestBuilder extends CoreRequestBuilder { $on = $this->exprJoinFollowing($qb, $actor, false); $on->add($this->exprLimitToRecipient($qb, ACore::CONTEXT_PUBLIC, false)); $on->add($this->exprLimitToRecipient($qb, $actor->getId(), true)); - $qb->join($this->defaultSelectAlias, CoreRequestBuilder::TABLE_SERVER_FOLLOWS, 'f', $on); + $qb->join($this->defaultSelectAlias, CoreRequestBuilder::TABLE_FOLLOWS, 'f', $on); } @@ -156,7 +156,7 @@ class NotesRequestBuilder extends CoreRequestBuilder { $on = $this->exprJoinFollowing($qb, $actor); - $qb->join($this->defaultSelectAlias, CoreRequestBuilder::TABLE_SERVER_FOLLOWS, 'f', $on); + $qb->join($this->defaultSelectAlias, CoreRequestBuilder::TABLE_FOLLOWS, 'f', $on); } diff --git a/lib/Db/StreamQueueRequestBuilder.php b/lib/Db/StreamQueueRequestBuilder.php index b66cec1c..2b4760fe 100644 --- a/lib/Db/StreamQueueRequestBuilder.php +++ b/lib/Db/StreamQueueRequestBuilder.php @@ -47,7 +47,7 @@ class StreamQueueRequestBuilder extends CoreRequestBuilder { */ protected function getStreamQueueInsertSql(): IQueryBuilder { $qb = $this->dbConnection->getQueryBuilder(); - $qb->insert(self::TABLE_QUEUE_STREAM); + $qb->insert(self::TABLE_STREAM_QUEUE); return $qb; } @@ -60,7 +60,7 @@ class StreamQueueRequestBuilder extends CoreRequestBuilder { */ protected function getStreamQueueUpdateSql(): IQueryBuilder { $qb = $this->dbConnection->getQueryBuilder(); - $qb->update(self::TABLE_QUEUE_STREAM); + $qb->update(self::TABLE_STREAM_QUEUE); return $qb; } @@ -78,7 +78,7 @@ class StreamQueueRequestBuilder extends CoreRequestBuilder { $qb->select( 'qs.id', 'qs.token', 'qs.stream_id', 'qs.type', 'qs.status', 'qs.tries', 'qs.last' ) - ->from(self::TABLE_QUEUE_STREAM, 'qs'); + ->from(self::TABLE_STREAM_QUEUE, 'qs'); $this->defaultSelectAlias = 'qs'; @@ -93,7 +93,7 @@ class StreamQueueRequestBuilder extends CoreRequestBuilder { */ protected function getStreamQueueDeleteSql(): IQueryBuilder { $qb = $this->dbConnection->getQueryBuilder(); - $qb->delete(self::TABLE_QUEUE_STREAM); + $qb->delete(self::TABLE_STREAM_QUEUE); return $qb; } diff --git a/lib/Migration/Version0001Date20181204203147.php b/lib/Migration/Version0001Date20181204203147.php deleted file mode 100644 index c98b319b..00000000 --- a/lib/Migration/Version0001Date20181204203147.php +++ /dev/null @@ -1,353 +0,0 @@ -<?php -declare(strict_types=1); -/** - * @copyright Copyright (c) 2018, Roeland Jago Douma <roeland@famdouma.nl> - * - * @author Roeland Jago Douma <roeland@famdouma.nl> - * - * @license GNU AGPL version 3 or any later version - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * - */ - -namespace OCA\Social\Migration; - -use Closure; -use OCP\DB\ISchemaWrapper; -use OCP\Migration\SimpleMigrationStep; -use OCP\Migration\IOutput; - -class Version0001Date20181204203147 extends SimpleMigrationStep { - - /** - * @param IOutput $output - * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` - * @param array $options - * @return null|ISchemaWrapper - */ - public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) { - /** @var ISchemaWrapper $schema */ - $schema = $schemaClosure(); - - if (!$schema->hasTable('social_server_actors')) { - $table = $schema->createTable('social_server_actors'); - $table->addColumn('id', 'string', [ - 'notnull' => true, - 'length' => 127, - ]); - $table->addColumn('user_id', 'string', [ - 'notnull' => true, - 'length' => 63, - ]); - $table->addColumn('preferred_username', 'string', [ - 'notnull' => true, - 'length' => 127, - ]); - $table->addColumn('name', 'string', [ - 'notnull' => true, - 'length' => 127, - ]); - $table->addColumn('summary', 'string', [ - 'notnull' => true, - 'length' => 3000, - ]); - $table->addColumn('public_key', 'string', [ - 'notnull' => false, - 'length' => 1000, - ]); - $table->addColumn('private_key', 'string', [ - 'notnull' => false, - 'length' => 2000, - ]); - $table->addColumn('avatar_version', 'integer', [ - 'notnull' => false, - 'length' => 2, - ]); - $table->addColumn('creation', 'datetime', [ - 'notnull' => false, - ]); - $table->setPrimaryKey(['id']); - } - - if (!$schema->hasTable('social_server_follows')) { - $table = $schema->createTable('social_server_follows'); - $table->addColumn('id', 'string', [ - 'notnull' => true, - 'length' => 127, - ]); - $table->addColumn('type', 'string', [ - 'notnull' => false, - 'length' => 31, - ]); - $table->addColumn('actor_id', 'string', [ - 'notnull' => true, - 'length' => 127, - ]); - $table->addColumn('object_id', 'string', [ - 'notnull' => true, - 'length' => 127, - ]); - $table->addColumn('follow_id', 'string', [ - 'notnull' => true, - 'length' => 127, - ]); - $table->addColumn('accepted', 'boolean', [ - 'notnull' => true, - 'default' => false - ]); - $table->addColumn('creation', 'datetime', [ - 'notnull' => false, - ]); - $table->setPrimaryKey(['id']); - } - - if (!$schema->hasTable('social_server_notes')) { - $table = $schema->createTable('social_server_notes'); - $table->addColumn('id', 'string', [ - 'notnull' => true, - 'length' => 127, - ]); - $table->addColumn('type', 'string', [ - 'notnull' => true, - 'length' => 31, - ]); - $table->addColumn('to', 'string', [ - 'notnull' => true, - 'length' => 127, - ]); - $table->addColumn('to_array', 'string', [ - 'notnull' => true, - 'length' => 2000, - ]); - $table->addColumn('cc', 'string', [ - 'notnull' => true, - 'length' => 127, - ]); - $table->addColumn('bcc', 'string', [ - 'notnull' => true, - 'length' => 127, - ]); - $table->addColumn('content', 'string', [ - 'notnull' => true, - 'length' => 3000, - ]); - $table->addColumn('summary', 'string', [ - 'notnull' => true, - 'length' => 3000, - ]); - $table->addColumn('published', 'string', [ - 'notnull' => true, - 'length' => 31, - ]); - $table->addColumn('published_time', 'datetime', [ - 'notnull' => false, - ]); - $table->addColumn('attributed_to', 'string', [ - 'notnull' => false, - 'length' => 127, - ]); - $table->addColumn('in_reply_to', 'string', [ - 'notnull' => false, - 'length' => 127, - ]); - $table->addColumn('source', 'string', [ - 'notnull' => true, - 'length' => 3000, - ]); - $table->addColumn('instances', 'string', [ - 'notnull' => true, - 'length' => 3000, - ]); - $table->addColumn('creation', 'datetime', [ - 'notnull' => false, - ]); - $table->addColumn('local', 'boolean', [ - 'notnull' => true, - 'default' => false - ]); - $table->setPrimaryKey(['id']); - } - - if (!$schema->hasTable('social_cache_actors')) { - $table = $schema->createTable('social_cache_actors'); - $table->addColumn('id', 'string', [ - 'notnull' => true, - 'length' => 127, - ]); - $table->addColumn('type', 'string', [ - 'notnull' => true, - 'length' => 31, - ]); - $table->addColumn('account', 'string', [ - 'notnull' => true, - 'length' => 127, - ]); - $table->addColumn('local', 'boolean', [ - 'notnull' => true, - 'default' => false - ]); - $table->addColumn('following', 'string', [ - 'notnull' => true, - 'length' => 127, - ]); - $table->addColumn('followers', 'string', [ - 'notnull' => true, - 'length' => 127, - ]); - $table->addColumn('inbox', 'string', [ - 'notnull' => true, - 'length' => 127, - ]); - $table->addColumn('shared_inbox', 'string', [ - 'notnull' => true, - 'length' => 127, - ]); - $table->addColumn('outbox', 'string', [ - 'notnull' => true, - 'length' => 127, - ]); - $table->addColumn('featured', 'string', [ - 'notnull' => true, - 'length' => 127, - ]); - $table->addColumn('url', 'string', [ - 'notnull' => true, - 'length' => 127, - ]); - $table->addColumn('preferred_username', 'string', [ - 'notnull' => true, - 'length' => 127, - ]); - $table->addColumn('name', 'string', [ - 'notnull' => true, - 'length' => 127, - ]); - $table->addColumn('icon_id', 'string', [ - 'notnull' => false, - 'length' => 127, - ]); - $table->addColumn('summary', 'string', [ - 'notnull' => true, - 'length' => 3000, - ]); - $table->addColumn('public_key', 'string', [ - 'notnull' => true, - 'length' => 500, - ]); - $table->addColumn('source', 'string', [ - 'notnull' => true, - 'length' => 3000, - ]); - $table->addColumn('details', 'string', [ - 'notnull' => false, - 'length' => 3000, - ]); - $table->addColumn('creation', 'datetime', [ - 'notnull' => false, - ]); - $table->setPrimaryKey(['id']); - } - - if (!$schema->hasTable('social_cache_documents')) { - $table = $schema->createTable('social_cache_documents'); - $table->addColumn('id', 'string', [ - 'notnull' => true, - 'length' => 127, - ]); - $table->addColumn('type', 'string', [ - 'notnull' => true, - 'length' => 31, - ]); - $table->addColumn('media_type', 'string', [ - 'notnull' => true, - 'length' => 63, - ]); - $table->addColumn('mime_type', 'string', [ - 'notnull' => true, - 'length' => 63, - ]); - $table->addColumn('url', 'string', [ - 'notnull' => true, - 'length' => 127, - ]); - $table->addColumn('local_copy', 'string', [ - 'notnull' => true, - 'length' => 127, - ]); - $table->addColumn('public', 'boolean', [ - 'notnull' => true, - 'default' => false - ]); - $table->addColumn('error', 'smallint', [ - 'notnull' => true, - 'length' => 1, - ]); - $table->addColumn('creation', 'datetime', [ - 'notnull' => false, - ]); - $table->addColumn('caching', 'datetime', [ - 'notnull' => false, - ]); - $table->setPrimaryKey(['id']); - $table->addUniqueIndex(['url'], 'unique_url'); - } - - if (!$schema->hasTable('social_request_queue')) { - $table = $schema->createTable('social_request_queue'); - $table->addColumn('id', 'bigint', [ - 'autoincrement' => true, - 'notnull' => true, - 'length' => 11, - 'unsigned' => true, - ]); - $table->addColumn('token', 'string', [ - 'notnull' => true, - 'length' => 63, - ]); - $table->addColumn('author', 'string', [ - 'notnull' => true, - 'length' => 127, - ]); - $table->addColumn('activity', 'string', [ - 'notnull' => true, - 'length' => 6000, - ]); - $table->addColumn('instance', 'string', [ - 'notnull' => false, - 'length' => 500, - ]); - $table->addColumn('priority', 'smallint', [ - 'notnull' => false, - 'length' => 1, - 'default' => 0, - ]); - $table->addColumn('status', 'smallint', [ - 'notnull' => false, - 'length' => 1, - 'default' => 0, - ]); - $table->addColumn('tries', 'smallint', [ - 'notnull' => false, - 'length' => 2, - 'd |