-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
namespace Miaoxing\App\Migration; | ||
|
||
use Miaoxing\Plugin\BaseMigration; | ||
|
||
class V20170117120936CreateApiLogsTable extends BaseMigration | ||
{ | ||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function up() | ||
{ | ||
$this->schema->table('apiLogs') | ||
->id() | ||
->int('appId') | ||
->mediumInt('code')->comment('HTTP请求或接口返回的状态码') | ||
->string('url')->comment('请求地址') | ||
->text('options')->comment('请求参数') | ||
->mediumText('req') | ||
->mediumText('res') | ||
->timestamp('createTime') | ||
->timestamp('createUser') | ||
->exec(); | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function down() | ||
{ | ||
$this->schema->dropIfExists('apiLogs'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
namespace Miaoxing\App\Migration; | ||
|
||
use Miaoxing\Plugin\BaseMigration; | ||
|
||
class V20170117121751CreateTrashTable extends BaseMigration | ||
{ | ||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function up() | ||
{ | ||
$this->schema->table('trash') | ||
->id() | ||
->string('tableName', 64) | ||
->softDeletable() | ||
->exec(); | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function down() | ||
{ | ||
$this->schema->dropIfExists('trash'); | ||
} | ||
} |