This commit is contained in:
2023-08-14 18:56:45 +08:00
parent 0a567634d6
commit 4a51a8a336
5 changed files with 22 additions and 3 deletions
+10
View File
@@ -265,6 +265,16 @@ abstract class Model extends Component implements ModelInterface, ArrayAccess, T
}
/**
* @return mixed
* @throws Exception
*/
public function optimize(): mixed
{
return static::query()->execute('OPTIMIZE TABLE ' . $this->getTable())->exec();
}
/**
* @return static
*/