mirror of
https://gitee.com/hyperf/hyperf.git
synced 2024-12-01 19:27:39 +08:00
Added method Hyperf\Database\Schema\Blueprint::engine()
. (#7156)
This commit is contained in:
parent
d4aa1c2087
commit
b332642bd4
@ -4,6 +4,7 @@
|
||||
|
||||
- [#7148](https://github.com/hyperf/hyperf/pull/7148) Added `exclude` rules for `hyperf/validation`.
|
||||
- [#7150](https://github.com/hyperf/hyperf/pull/7150) Added missing methods (`accepted_if`, `ascii`, `date_equals`...) to validation messages.
|
||||
- [#7156](https://github.com/hyperf/hyperf/pull/7156) Added method `Hyperf\Database\Schema\Blueprint::engine()`.
|
||||
|
||||
# v3.1.45 - 2024-11-14
|
||||
|
||||
|
@ -198,6 +198,22 @@ class Blueprint
|
||||
return $this->addCommand('create');
|
||||
}
|
||||
|
||||
/**
|
||||
* Specify the storage engine that should be used for the table.
|
||||
*/
|
||||
public function engine(string $engine): void
|
||||
{
|
||||
$this->engine = $engine;
|
||||
}
|
||||
|
||||
/**
|
||||
* Specify that the InnoDB storage engine should be used for the table (MySQL only).
|
||||
*/
|
||||
public function innoDb(): void
|
||||
{
|
||||
$this->engine('InnoDB');
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the table comment.
|
||||
*/
|
||||
|
@ -158,7 +158,7 @@ class MySqlSchemaGrammarTest extends TestCase
|
||||
$blueprint->create();
|
||||
$blueprint->increments('id');
|
||||
$blueprint->string('email');
|
||||
$blueprint->engine = 'InnoDB';
|
||||
$blueprint->engine('InnoDB');
|
||||
|
||||
$conn = $this->getConnection();
|
||||
$conn->shouldReceive('getConfig')->once()->with('charset')->andReturn('utf8');
|
||||
|
Loading…
Reference in New Issue
Block a user