2023071600-drop_stream_media.php 926 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. declare(strict_types=1);
  3. use App\Interfaces\MigrationInterface;
  4. use App\Services\DB;
  5. return new class() implements MigrationInterface {
  6. public function up(): int
  7. {
  8. DB::getPdo()->exec('
  9. DROP TABLE IF EXISTS `stream_media`;
  10. ');
  11. return 2023071600;
  12. }
  13. public function down(): int
  14. {
  15. DB::getPdo()->exec(
  16. "CREATE TABLE IF NOT EXISTS `stream_media` (
  17. `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '记录ID',
  18. `node_id` bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT '节点ID',
  19. `result` text NOT NULL DEFAULT '' COMMENT '检测结果',
  20. `created_at` int(11) unsigned NOT NULL DEFAULT 0 COMMENT '创建时间',
  21. PRIMARY KEY (`id`)
  22. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;"
  23. );
  24. return 2023071000;
  25. }
  26. };