42 lines
876 B
PHP
42 lines
876 B
PHP
![]() |
<?php
|
||
|
|
||
|
use think\admin\extend\PhinxExtend;
|
||
|
use think\migration\Migrator;
|
||
|
|
||
|
@set_time_limit(0);
|
||
|
@ini_set('memory_limit', -1);
|
||
|
|
||
|
class InstallOrderssTable extends Migrator
|
||
|
{
|
||
|
|
||
|
/**
|
||
|
* 创建数据库
|
||
|
*/
|
||
|
public function change()
|
||
|
{
|
||
|
$this->_create_orderss();
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* 创建数据对象
|
||
|
* @class Orderss
|
||
|
* @table orderss
|
||
|
* @return void
|
||
|
*/
|
||
|
private function _create_orderss()
|
||
|
{
|
||
|
// 创建数据表对象
|
||
|
$table = $this->table('orderss', [
|
||
|
'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '',
|
||
|
]);
|
||
|
// 创建或更新数据表
|
||
|
PhinxExtend::upgrade($table, [
|
||
|
['order_id', 'string', ['limit' => 300, 'default' => NULL, 'null' => false, 'comment' => '']],
|
||
|
['status', 'integer', ['default' => '1', 'null' => false, 'comment' => '']],
|
||
|
], [
|
||
|
|
||
|
], false);
|
||
|
}
|
||
|
|
||
|
}
|