新增添加索引和删除索引方法
This commit is contained in:
@@ -204,6 +204,30 @@ class Table
|
||||
])->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);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取适配器
|
||||
*
|
||||
|
Reference in New Issue
Block a user