20260525061907_create_price_adjust_cate.php 1.5 KB

123456789101112131415161718192021222324252627
  1. <?php
  2. use Phinx\Db\Adapter\MysqlAdapter;
  3. use think\migration\Migrator;
  4. use think\migration\db\Column;
  5. class CreatePriceAdjustCate extends Migrator
  6. {
  7. public function change(): void {
  8. $table = $this->table('price_adjust_cate', [
  9. 'engine' => 'InnoDB',
  10. 'collation' => 'utf8mb4_general_ci',
  11. 'comment' => '调价申请类型字典表',
  12. ]);
  13. $table
  14. ->addColumn('type', 'integer', ['limit' => MysqlAdapter::INT_TINY, 'null' => false, 'default' => 0, 'comment' => '类型:1客户交易场景,2卡BIN'])
  15. ->addColumn('title', 'string', ['limit' => 100, 'null' => false, 'default' => '', 'comment' => '名称'])
  16. ->addColumn('value', 'integer', ['null' => false, 'default' => 0, 'comment' => '业务值(同type内唯一,申请单存此值)'])
  17. ->addColumn('is_other', 'integer', ['limit' => MysqlAdapter::INT_TINY, 'null' => false, 'default' => 0, 'comment' => '是否为其他选项:1是(选中后需填备注)'])
  18. ->addColumn('sort', 'integer', ['null' => false, 'default' => 0, 'comment' => '排序'])
  19. ->addColumn('status', 'integer', ['limit' => MysqlAdapter::INT_TINY, 'null' => false, 'default' => 1, 'comment' => '状态:0禁用,1启用'])
  20. ->addColumn('create_time', 'biginteger', ['null' => false, 'default' => 0, 'comment' => '创建时间'])
  21. ->addColumn('delete_time', 'biginteger', ['null' => false, 'default' => 0, 'comment' => '删除时间'])
  22. ->create();
  23. }
  24. }