新增添加索引和删除索引方法

This commit is contained in:
JaguarJack
2021-05-03 10:55:54 +08:00
parent 8714f80716
commit afeca7286c

View File

@@ -204,6 +204,30 @@ class Table
])->update(); ])->update();
} }
/**
* 删除 index
*
* @time 2021年04月30日
* @param string $column
* @return void
*/
public static function dropIndex(string $column)
{
self::getTable()->removeIndex([$column])->update();
}
/**
* column 是否是索引
*
* @time 2021年04月30日
* @param string $column
* @return bool
*/
public static function isIndex(string $column): bool
{
return self::getTable()->hasIndex($column);
}
/** /**
* 获取适配器 * 获取适配器
* *