| 12345678910111213141516171819202122232425262728293031 |
- <?php
- use Illuminate\Database\Migrations\Migration;
- use Illuminate\Database\Schema\Blueprint;
- use Illuminate\Support\Facades\Schema;
- return new class extends Migration
- {
- public function up(): void
- {
- Schema::create('submissions', function (Blueprint $table) {
- $table->id();
- $table->string('name', 100);
- $table->string('email', 255);
- $table->text('message')->nullable();
- $table->string('ip_address', 45)->nullable();
- $table->enum('status', ['active', 'archived', 'pending'])->default('active');
- $table->timestamps();
- $table->softDeletes();
-
- $table->index('email');
- $table->index('status');
- $table->index('created_at');
- });
- }
- public function down(): void
- {
- Schema::dropIfExists('submissions');
- }
- };
|