20221031185300_custom_config_json.php 482 B

12345678910111213141516171819202122
  1. <?php
  2. declare(strict_types=1);
  3. use Phinx\Migration\AbstractMigration;
  4. final class CustomConfigJson extends AbstractMigration
  5. {
  6. public function up(): void
  7. {
  8. $this->table('node')
  9. ->changeColumn('custom_config', 'json', [ 'comment' => '自定义配置', 'default' => '{}' ])
  10. ->save();
  11. }
  12. public function down(): void
  13. {
  14. $this->table('node')
  15. ->changeColumn('custom_config', 'text')
  16. ->save();
  17. }
  18. }