feat(scheme): 新增数据库表结构同步方案

This commit is contained in:
augushong
2026-01-09 21:08:51 +08:00
parent 1a39354287
commit 8de6b99bb3
24 changed files with 944 additions and 3 deletions

View File

@@ -10,6 +10,9 @@ use app\common\command\admin\Update;
use app\common\command\admin\UpdateCode;
use app\common\command\curd\Migrate;
use app\common\command\Timer;
use app\common\command\scheme\Make;
use app\common\command\scheme\Sync;
use app\common\command\scheme\Backup;
return [
// 指令定义
@@ -23,6 +26,9 @@ return [
Migrate::class,
Clear::class,
Update::class,
UpdateCode::class
UpdateCode::class,
Make::class,
Sync::class,
Backup::class,
],
];

View File

@@ -6,7 +6,7 @@ use think\facade\Env;
return [
// 默认使用的数据库连接配置
'default' => Env::get('database.type', 'sqlite'),
'default' => Env::get('database.main', 'sqlite'),
// 自定义时间查询规则
'time_query_rule' => [],
@@ -21,7 +21,7 @@ return [
// 数据库连接配置信息
'connections' => [
'mysql' => [
'main' => [
// 数据库类型
'type' => Env::get('database.type', 'mysql'),
// 服务器地址

11
config/scheme.php Normal file
View File

@@ -0,0 +1,11 @@
<?php
return [
// 忽略的表 (不参与 scheme 同步)
'ignore_tables' => [
'migrations',
'phinxlog',
],
// 备份中间前缀
'backup_prefix' => 'backup',
];