Skip to content

Commit

Permalink
增加apiLogs和trash表 #2606
Browse files Browse the repository at this point in the history
  • Loading branch information
twinh committed Jan 17, 2017
1 parent 2e6a55e commit a4734db
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 0 deletions.
34 changes: 34 additions & 0 deletions src/Migration/V20170117120936CreateApiLogsTable.php
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');
}
}
28 changes: 28 additions & 0 deletions src/Migration/V20170117121751CreateTrashTable.php
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');
}
}

0 comments on commit a4734db

Please sign in to comment.