1
0

2024012000-add_payback_invoice_id.php 570 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 payback ADD COLUMN IF NOT EXISTS `invoice_id` bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT '账单ID';
  10. ");
  11. return 2024012000;
  12. }
  13. public function down(): int
  14. {
  15. DB::getPdo()->exec('
  16. ALTER TABLE payback DROP COLUMN IF EXISTS `invoice_id`;
  17. ');
  18. return 2023120700;
  19. }
  20. };