1
0
mirror of https://gitee.com/koogua/course-tencent-cloud.git synced 2025-06-28 05:11:39 +08:00
course-tencent-cloud/db/migrations/20210610034658.php
koogua 0336a54911 1.源文件增加版权信息
2.群组状态和课程协同
2021-06-13 15:49:47 +08:00

50 lines
1.2 KiB
PHP

<?php
/**
* @copyright Copyright (c) 2021 深圳市酷瓜软件有限公司
* @license https://opensource.org/licenses/GPL-2.0
* @link https://www.koogua.com
*/
use Phinx\Migration\AbstractMigration;
final class V20210610034658 extends AbstractMigration
{
public function up()
{
$this->modifyChapterVodTable();
$this->handleVodFileRemote();
}
public function down()
{
$this->table('kg_chapter_vod')
->removeColumn('file_remote')
->save();
}
protected function modifyChapterVodTable()
{
$this->table('kg_chapter_vod')
->addColumn('file_remote', 'string', [
'null' => false,
'default' => '',
'limit' => 1500,
'collation' => 'utf8mb4_general_ci',
'encoding' => 'utf8mb4',
'comment' => '远程文件',
'after' => 'file_transcode',
])->save();
}
protected function handleVodFileRemote()
{
$this->getQueryBuilder()
->update('kg_chapter_vod')
->set('file_remote', '[]')
->where(['file_remote' => ''])
->execute();
}
}