kopia lustrzana https://github.com/nextcloud/social
				
				
				
			varchar->text
							rodzic
							
								
									87252d92bb
								
							
						
					
					
						commit
						c1e387c08f
					
				|  | @ -64,11 +64,6 @@ class CacheActorsRequest extends CacheActorsRequestBuilder { | |||
| 	 * @param Person $actor | ||||
| 	 */ | ||||
| 	public function save(Person $actor) { | ||||
| 		$source = $actor->getSource(); | ||||
| 		if (strlen($source) >= CoreRequestBuilder::SOURCE_LENGTH) { | ||||
| 			$source = 'too_big'; | ||||
| 		} | ||||
| 
 | ||||
| 		$qb = $this->getCacheActorsInsertSql(); | ||||
| 		$qb->setValue('id', $qb->createNamedParameter($actor->getId())) | ||||
| 		   ->setValue('account', $qb->createNamedParameter($actor->getAccount())) | ||||
|  | @ -87,7 +82,7 @@ class CacheActorsRequest extends CacheActorsRequestBuilder { | |||
| 		   ->setValue('name', $qb->createNamedParameter($actor->getName())) | ||||
| 		   ->setValue('summary', $qb->createNamedParameter($actor->getSummary())) | ||||
| 		   ->setValue('public_key', $qb->createNamedParameter($actor->getPublicKey())) | ||||
| 		   ->setValue('source', $qb->createNamedParameter($source)) | ||||
| 		   ->setValue('source', $qb->createNamedParameter($actor->getSource())) | ||||
| 		   ->setValue('details', $qb->createNamedParameter(json_encode($actor->getDetails()))) | ||||
| 		   ->setValue( | ||||
| 			   'creation', | ||||
|  |  | |||
|  | @ -64,9 +64,6 @@ class CoreRequestBuilder { | |||
| 	const TABLE_CACHE_DOCUMENTS = 'social_cache_documents'; | ||||
| 
 | ||||
| 	 | ||||
| 	const SOURCE_LENGTH = 10000; | ||||
| 
 | ||||
| 
 | ||||
| 	/** @var IDBConnection */ | ||||
| 	protected $dbConnection; | ||||
| 
 | ||||
|  |  | |||
|  | @ -66,11 +66,6 @@ class NotesRequest extends NotesRequestBuilder { | |||
| 		$dTime = new DateTime(); | ||||
| 		$dTime->setTimestamp($note->getPublishedTime()); | ||||
| 
 | ||||
| 		$source = $note->getSource(); | ||||
| 		if (strlen($source) >= CoreRequestBuilder::SOURCE_LENGTH) { | ||||
| 			$source = 'too_big'; | ||||
| 		} | ||||
| 
 | ||||
| 		$qb = $this->getNotesInsertSql(); | ||||
| 		$qb->setValue('id', $qb->createNamedParameter($note->getId())) | ||||
| 		   ->setValue('type', $qb->createNamedParameter($note->getType())) | ||||
|  | @ -98,7 +93,7 @@ class NotesRequest extends NotesRequestBuilder { | |||
| 		   ) | ||||
| 		   ->setValue('attributed_to', $qb->createNamedParameter($note->getAttributedTo())) | ||||
| 		   ->setValue('in_reply_to', $qb->createNamedParameter($note->getInReplyTo())) | ||||
| 		   ->setValue('source', $qb->createNamedParameter($source)) | ||||
| 		   ->setValue('source', $qb->createNamedParameter($note->getSource())) | ||||
| 		   ->setValue( | ||||
| 			   'instances', $qb->createNamedParameter( | ||||
| 			   json_encode($note->getInstancePaths(), JSON_UNESCAPED_SLASHES) | ||||
|  |  | |||
|  | @ -32,6 +32,9 @@ namespace OCA\Social\Migration; | |||
| 
 | ||||
| 
 | ||||
| use Closure; | ||||
| use Doctrine\DBAL\DBALException; | ||||
| use Doctrine\DBAL\Schema\SchemaException; | ||||
| use Doctrine\DBAL\Types\Type; | ||||
| use OCA\Social\Db\CoreRequestBuilder; | ||||
| use OCP\DB\ISchemaWrapper; | ||||
| use OCP\Migration\IOutput; | ||||
|  | @ -39,11 +42,11 @@ use OCP\Migration\SimpleMigrationStep; | |||
| 
 | ||||
| 
 | ||||
| /** | ||||
|  * Class Version0001Date20181208185242 | ||||
|  * Class Version0001Date20181211222142 | ||||
|  * | ||||
|  * @package OCA\Social\Migration | ||||
|  */ | ||||
| class Version0001Date20181208185242 extends SimpleMigrationStep { | ||||
| class Version0001Date20181211222142 extends SimpleMigrationStep { | ||||
| 
 | ||||
| 
 | ||||
| 	/** | ||||
|  | @ -52,7 +55,8 @@ class Version0001Date20181208185242 extends SimpleMigrationStep { | |||
| 	 * @param array $options | ||||
| 	 * | ||||
| 	 * @return ISchemaWrapper | ||||
| 	 * @throws \Doctrine\DBAL\Schema\SchemaException | ||||
| 	 * @throws SchemaException | ||||
| 	 * @throws DBALException | ||||
| 	 */ | ||||
| 	public function changeSchema(IOutput $output, Closure $schemaClosure, array $options | ||||
| 	): ISchemaWrapper { | ||||
|  | @ -62,27 +66,28 @@ class Version0001Date20181208185242 extends SimpleMigrationStep { | |||
| 		$table = $schema->getTable(CoreRequestBuilder::TABLE_CACHE_ACTORS); | ||||
| 		$table->changeColumn( | ||||
| 			'source', [ | ||||
| 						'notnull' => true, | ||||
| 						'length'  => CoreRequestBuilder::SOURCE_LENGTH, | ||||
| 						'notnull' => false, | ||||
| 						'type'    => Type::getType(Type::TEXT) | ||||
| 					] | ||||
| 		); | ||||
| 
 | ||||
| 		$table = $schema->getTable(CoreRequestBuilder::TABLE_SERVER_NOTES); | ||||
| 		$table->changeColumn( | ||||
| 			'source', [ | ||||
| 						'notnull' => true, | ||||
| 						'length'  => CoreRequestBuilder::SOURCE_LENGTH, | ||||
| 						'notnull' => false, | ||||
| 						'type'    => Type::getType(Type::TEXT) | ||||
| 					] | ||||
| 		); | ||||
| 
 | ||||
| 		$table = $schema->getTable(CoreRequestBuilder::TABLE_REQUEST_QUEUE); | ||||
| 		$table->changeColumn( | ||||
| 			'activity', [ | ||||
| 						  'notnull' => true, | ||||
| 						  'length'  => CoreRequestBuilder::SOURCE_LENGTH, | ||||
| 						  'notnull' => false, | ||||
| 						  'type'    => Type::getType(Type::TEXT) | ||||
| 					  ] | ||||
| 		); | ||||
| 
 | ||||
| 		return $schema; | ||||
| 	} | ||||
| } | ||||
| 
 | ||||
		Ładowanie…
	
		Reference in New Issue
	
	 Maxence Lange
						Maxence Lange