From 39cd9704b845a3146a1d8233330ed6d156728172 Mon Sep 17 00:00:00 2001 From: Maxence Lange Date: Wed, 6 Mar 2019 11:57:30 -0100 Subject: [PATCH] force large field to 1000 Signed-off-by: Maxence Lange --- lib/Migration/Version0002Date20190226000001.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/Migration/Version0002Date20190226000001.php b/lib/Migration/Version0002Date20190226000001.php index 0ec6dde6..a0408fa6 100644 --- a/lib/Migration/Version0002Date20190226000001.php +++ b/lib/Migration/Version0002Date20190226000001.php @@ -79,6 +79,9 @@ class Version0002Date20190226000001 extends SimpleMigrationStep { [CoreRequestBuilder::TABLE_SERVER_FOLLOWS, 'object_id'], [CoreRequestBuilder::TABLE_SERVER_FOLLOWS, 'follow_id'], + [CoreRequestBuilder::TABLE_SERVER_NOTES, 'to_array'], + [CoreRequestBuilder::TABLE_SERVER_NOTES, 'cc'], + [CoreRequestBuilder::TABLE_SERVER_NOTES, 'bcc'], [CoreRequestBuilder::TABLE_SERVER_NOTES, 'id'], [CoreRequestBuilder::TABLE_SERVER_NOTES, 'to'], [CoreRequestBuilder::TABLE_SERVER_NOTES, 'attributed_to'], @@ -137,12 +140,22 @@ class Version0002Date20190226000001 extends SimpleMigrationStep { * @param IOutput $output * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` * @param array $options + * + * @throws SchemaException */ public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options) { + /** @var ISchemaWrapper $schema */ + $schema = $schemaClosure(); + foreach (array_merge(self::$editToText, self::$editToChar1000) as $edit) { list($tableName, $field) = $edit; + $table = $schema->getTable($tableName); + if (!$table->hasColumn($field)) { + continue; + } + $qb = $this->connection->getQueryBuilder(); $qb->update($tableName) ->set($field . '_copy', $field)