20250712025652_extension_eav_attribute_option.php 955 B

12345678910111213141516171819202122232425
  1. <?php
  2. declare(strict_types=1);
  3. use Phinx\Migration\AbstractMigration;
  4. class ExtensionEavAttributeOption extends AbstractMigration
  5. {
  6. /**
  7. * Change Method.
  8. *
  9. * Write your reversible migrations using this method.
  10. */
  11. public function change()
  12. {
  13. $table = $this->table('extension_eav_attribute_option', ['engine' => 'InnoDB', 'comment' => '属性选项表']);
  14. $table->addColumn('attribute_id', 'integer', ['signed' => false, 'comment' => '属性ID'])
  15. ->addColumn('label', 'string', ['comment' => '显示文本'])
  16. ->addColumn('value', 'string', ['comment' => '选项值'])
  17. ->addColumn('sort', 'integer', ['signed' => false, 'comment' => '排序'])
  18. ->addTimestamps('create_time', 'update_time')
  19. ->addColumn('delete_time', 'timestamp', ['null' => true, 'comment' => '删除时间'])
  20. ->addIndex(['attribute_id'])
  21. ->create();
  22. }
  23. }