0001_01_01_000004_create_applications_table.php 940 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Support\Facades\Schema;
  5. return new class extends Migration
  6. {
  7. public function up(): void
  8. {
  9. Schema::create('applications', function (Blueprint $table) {
  10. $table->id();
  11. $table->integer('user_id');
  12. $table->integer('course_id');
  13. $table->date('start_date');
  14. $table->enum('payment_method', ['cash', 'phone_transfer']);
  15. $table->enum('status', ['new', 'in_progress', 'competed']);
  16. $table->text('comment')->nullable();
  17. $table->rememberToken();
  18. $table->timestamps();
  19. });
  20. }
  21. /**
  22. * Reverse the migrations.
  23. */
  24. public function down(): void
  25. {
  26. Schema::dropIfExists('users');
  27. Schema::dropIfExists('password_reset_tokens');
  28. Schema::dropIfExists('sessions');
  29. }
  30. };