2023082000-remove_user_expire_in.php 581 B

1234567891011121314151617181920212223242526
  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 user DROP COLUMN IF EXISTS `expire_in`;
  10. ');
  11. return 2023082000;
  12. }
  13. public function down(): int
  14. {
  15. DB::getPdo()->exec("
  16. ALTER TABLE user ADD COLUMN IF NOT EXISTS `expire_in` datetime NOT NULL DEFAULT '2199-01-01 00:00:00' COMMENT '账户过期时间';
  17. ");
  18. return 2023081800;
  19. }
  20. };