mirror of
https://devops.lemonos.cn/lawson/FendxPHP.git
synced 2026-06-15 23:12:49 +08:00
31 lines
778 B
PHP
31 lines
778 B
PHP
|
|
<?php
|
||
|
|
declare(strict_types=1);
|
||
|
|
|
||
|
|
use Fendx\Database\Schema\Schema;
|
||
|
|
use Fendx\Database\Migration;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 创建迁移记录表
|
||
|
|
*/
|
||
|
|
class CreateMigrationsTable extends Migration
|
||
|
|
{
|
||
|
|
public function up(): void
|
||
|
|
{
|
||
|
|
Schema::create('migrations', function (Schema\Table $table) {
|
||
|
|
$table->id('id')->primary()->autoIncrement();
|
||
|
|
$table->string('migration', 255)->comment('迁移文件名');
|
||
|
|
$table->integer('batch')->comment('批次号');
|
||
|
|
$table->timestamp('ran_at')->useCurrent()->comment('执行时间');
|
||
|
|
|
||
|
|
// 索引
|
||
|
|
$table->index('migration');
|
||
|
|
$table->index('batch');
|
||
|
|
});
|
||
|
|
}
|
||
|
|
|
||
|
|
public function down(): void
|
||
|
|
{
|
||
|
|
Schema::dropIfExists('migrations');
|
||
|
|
}
|
||
|
|
}
|