|
- <?php
-
- use App\Util\MigrationHelper;
- use Illuminate\Database\Migrations\Migration;
- use Illuminate\Database\Schema\Blueprint;
- use Illuminate\Support\Facades\Schema;
-
- return new class extends Migration
- {
- /**
- * Run the migrations.
- */
- public function up(): void
- {
- MigrationHelper::createTable('contracts', $this->schema());
- MigrationHelper::createTable('contract_histories', $this->schema());
- }
-
- /**
- * Reverse the migrations.
- */
- public function down(): void
- {
- Schema::dropIfExists('contracts');
- Schema::dropIfExists('contract_histories');
- }
-
- private function schema()
- {
-
- return function (Blueprint $table, MigrationHelper $helper) {
- $helper->baseColumn();
-
- $table->string('name')->comment("契約者名")->nullable();
- $table->text('custom')->comment("カスタム")->nullable();
- };
- }
- };
|