1
0
mirror of https://gitee.com/koogua/course-tencent-cloud.git synced 2025-07-15 21:02:20 +08:00
course-tencent-cloud/db/migrations/20230910174508.php
xiaochong0302 1e3b60dbad 1.kg_course表增加索引
2.优化错误页
3.优化富文本内容长度获取
4.优化layer关闭窗口后发布状态同步
2023-09-16 20:51:57 +08:00

40 lines
869 B
PHP

<?php
/**
* @copyright Copyright (c) 2023 深圳市酷瓜软件有限公司
* @license https://opensource.org/licenses/GPL-2.0
* @link https://www.koogua.com
*/
use Phinx\Migration\AbstractMigration;
final class V20230910174508 extends AbstractMigration
{
public function up()
{
$this->alterCourseTable();
}
protected function alterCourseTable()
{
$table = $this->table('kg_course');
if (!$table->hasIndexByName('category_id')) {
$table->addIndex(['category_id'], [
'name' => 'category_id',
'unique' => false,
]);
}
if (!$table->hasIndexByName('teacher_id')) {
$table->addIndex(['teacher_id'], [
'name' => 'teacher_id',
'unique' => false,
]);
}
$table->save();
}
}