REAPI/database/migrations/20009999999987_install_ssss1234_table.php
mzeros b0fbd5c5a6 feat(database): 添加多个数据库迁移脚本
- 新增 test、taobao、system、suoka 和 stat 数据库表的迁移脚本- 包含各种数据表的创建和字段定义
- 为系统初始化、统计、对账等功能提供数据支持
2024-12-22 17:42:44 +08:00

48 lines
1.4 KiB
PHP

<?php
use think\admin\extend\PhinxExtend;
use think\migration\Migrator;
@set_time_limit(0);
@ini_set('memory_limit', -1);
class InstallSsss1234Table extends Migrator
{
/**
* 创建数据库
*/
public function change()
{
$this->_create_ssss1234();
}
/**
* 创建数据对象
* @class Ssss1234
* @table ssss1234
* @return void
*/
private function _create_ssss1234()
{
// 创建数据表对象
$table = $this->table('ssss1234', [
'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '',
]);
// 创建或更新数据表
PhinxExtend::upgrade($table, [
['order', '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' => '']],
['status', 'string', ['limit' => 255, 'default' => NULL, 'null' => true, 'comment' => '']],
['备注', 'integer', ['default' => NULL, 'null' => true, 'comment' => '']],
], [
], false);
}
}