2023111801-remove_detect_ban_log_user_info.php 776 B

12345678910111213141516171819202122232425262728
  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. ALTER TABLE detect_ban_log DROP COLUMN IF EXISTS `user_name`;
  10. ALTER TABLE detect_ban_log DROP COLUMN IF EXISTS `email`;
  11. ');
  12. return 2023111801;
  13. }
  14. public function down(): int
  15. {
  16. DB::getPdo()->exec("
  17. ALTER TABLE detect_ban_log ADD COLUMN IF NOT EXISTS `user_name` varchar(255) NOT NULL DEFAULT '' COMMENT '用户名';
  18. ALTER TABLE detect_ban_log ADD COLUMN IF NOT EXISTS `email` varchar(255) NOT NULL DEFAULT '' COMMENT '用户邮箱';
  19. ");
  20. return 2023111800;
  21. }
  22. };