REAPI/database/migrations/20009999999985_install_suoka_table.php

52 lines
1.8 KiB
PHP
Raw Normal View History

<?php
use think\admin\extend\PhinxExtend;
use think\migration\Migrator;
@set_time_limit(0);
@ini_set('memory_limit', -1);
class InstallSuokaTable extends Migrator
{
/**
* 创建数据库
*/
public function change()
{
$this->_create_suoka();
}
/**
* 创建数据对象
* @class Suoka
* @table suoka
* @return void
*/
private function _create_suoka()
{
// 创建数据表对象
$table = $this->table('suoka', [
'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '',
]);
// 创建或更新数据表
PhinxExtend::upgrade($table, [
['序号', 'integer', ['default' => NULL, 'null' => true, 'comment' => '']],
['商品', 'string', ['limit' => 255, 'default' => NULL, 'null' => true, 'comment' => '']],
['商户', 'string', ['limit' => 255, 'default' => NULL, 'null' => true, 'comment' => '']],
['ids', 'string', ['limit' => 255, 'default' => NULL, 'null' => true, 'comment' => '']],
['商户订单号', 'string', ['limit' => 255, 'default' => NULL, 'null' => true, 'comment' => '']],
['卡号', 'string', ['limit' => 255, 'default' => NULL, 'null' => true, 'comment' => '']],
['卡密', 'string', ['limit' => 255, 'default' => NULL, 'null' => true, 'comment' => '']],
['充值金额', 'integer', ['default' => NULL, 'null' => true, 'comment' => '']],
['状态', 'string', ['limit' => 255, 'default' => NULL, 'null' => true, 'comment' => '']],
['下单时间', 'string', ['limit' => 255, 'default' => NULL, 'null' => true, 'comment' => '']],
['耗时', 'string', ['limit' => 255, 'default' => NULL, 'null' => true, 'comment' => '']],
['同步结果', 'integer', ['default' => NULL, 'null' => true, 'comment' => '']],
], [
], false);
}
}