force large field to 1000

Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
feature/573/request-on-host-meta
Maxence Lange 2019-03-06 11:57:30 -01:00
rodzic 80f8f14f6c
commit 39cd9704b8
1 zmienionych plików z 13 dodań i 0 usunięć

Wyświetl plik

@ -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)