Files
Gnuboard7/database/migrations/2026_04_01_000003_create_cache_table.php
2026-04-01 10:30:52 +09:00

36 lines
905 B
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('cache', function (Blueprint $table) {
$table->string('key')->primary()->comment('캐시 키');
$table->mediumText('value')->comment('캐시 값');
$table->integer('expiration')->comment('만료 시간');
});
if (DB::getDriverName() == 'mysql') {
Schema::table('cache', function (Blueprint $table) {
$table->comment('시스템 캐시 데이터');
});
}
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('cache');
}
};