0001_01_01_000003_create_course_table.php 743 B

123456789101112131415161718192021222324252627282930
  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('courses', function (Blueprint $table) {
  10. $table->id();
  11. $table->string('name');
  12. $table->string('description');
  13. $table->decimal('price', 2, 8);
  14. $table->rememberToken();
  15. $table->timestamps();
  16. });
  17. }
  18. /**
  19. * Reverse the migrations.
  20. */
  21. public function down(): void
  22. {
  23. Schema::dropIfExists('users');
  24. Schema::dropIfExists('password_reset_tokens');
  25. Schema::dropIfExists('sessions');
  26. }
  27. };