2026_11_13_150500_create_telegram_channel_messages.php 1.1 KB

1234567891011121314151617181920212223242526272829303132
  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. public function up(): void
  7. {
  8. Schema::create('telegram_channel_messages', function (Blueprint $table) {
  9. $table->id();
  10. $table->unsignedBigInteger('channel_id');
  11. $table->string('channel_name', 255);
  12. $table->string('target', 64);
  13. $table->json('message');
  14. $table->boolean('is_top')->default(false);
  15. $table->string('status', 20);
  16. $table->dateTime('scheduled_at');
  17. $table->dateTime('attempted_at')->nullable();
  18. $table->unsignedBigInteger('telegram_message_id')->nullable();
  19. $table->boolean('pinned')->nullable();
  20. $table->text('error')->nullable();
  21. $table->timestamps();
  22. $table->index(['status', 'scheduled_at', 'id']);
  23. });
  24. }
  25. public function down(): void
  26. {
  27. Schema::dropIfExists('telegram_channel_messages');
  28. }
  29. };