2024_04_07_211410_create_notifications_table.php 942 B

12345678910111213141516171819202122232425262728293031323334
  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('notifications', function (Blueprint $table) {
  13. $table->id();
  14. $table->string('object_type', 30)->comment("action;announcement");
  15. $table->integer('object_id')->default(0);
  16. $table->text('content')->nullable();
  17. $table->timestamp("start_at")->nullable();
  18. $table->timestamp("end_at")->nullable();
  19. $table->integer("created_by")->nullable();
  20. $table->string("status", 30)->nullable();
  21. $table->timestamps();
  22. });
  23. }
  24. /**
  25. * Reverse the migrations.
  26. */
  27. public function down(): void
  28. {
  29. Schema::dropIfExists('notifications');
  30. }
  31. };