2023_12_02_171900_create_articles_table.php 805 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. /**
  8. * Run the migrations.
  9. */
  10. public function up(): void
  11. {
  12. Schema::create('articles', function (Blueprint $table) {
  13. $table->id();
  14. $table->timestamps();
  15. $table->softDeletes();
  16. $table->string("title");
  17. $table->text("content");
  18. $table->timestamp("published_at");
  19. $table->timestamp("unpublished_at");
  20. $table->tinyInteger("status")->unsigned()->default(0);
  21. });
  22. }
  23. /**
  24. * Reverse the migrations.
  25. */
  26. public function down(): void
  27. {
  28. Schema::dropIfExists('articles');
  29. }
  30. };