20250731075545_extension_payment_user_id.php 981 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. use Phinx\Migration\AbstractMigration;
  3. class ExtensionPaymentUserId extends AbstractMigration
  4. {
  5. /**
  6. * Change Method.
  7. *
  8. * Write your reversible migrations using this method.
  9. *
  10. * More information on writing migrations is available here:
  11. * http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
  12. *
  13. * The following commands can be used in this method and Phinx will
  14. * automatically reverse them when rolling back:
  15. *
  16. * createTable
  17. * renameTable
  18. * addColumn
  19. * renameColumn
  20. * addIndex
  21. * addForeignKey
  22. *
  23. * Remember to call "create()" or "update()" and NOT "save()" when working
  24. * with the Table class.
  25. */
  26. public function change()
  27. {
  28. $this->table('extension_payment')
  29. ->addColumn('user_id', 'integer', ['signed' => false, 'default' => 0, 'after' => 'id', 'comment' => '用户ID'])
  30. ->update();
  31. }
  32. }