diff --git a/extend/catcher/generate/support/Table.php b/extend/catcher/generate/support/Table.php index 903c798..595c83c 100644 --- a/extend/catcher/generate/support/Table.php +++ b/extend/catcher/generate/support/Table.php @@ -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); + } + /** * 获取适配器 *