20221108164734_create_agent_share_log_table.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. use think\migration\Migrator;
  3. use think\migration\db\Column;
  4. class CreateAgentShareLogTable extends Migrator
  5. {
  6. /**
  7. * Change Method.
  8. *
  9. * Write your reversible migrations using this method.
  10. *
  11. * More information on writing migrations is available here:
  12. * http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
  13. *
  14. * The following commands can be used in this method and Phinx will
  15. * automatically reverse them when rolling back:
  16. *
  17. * createTable
  18. * renameTable
  19. * addColumn
  20. * renameColumn
  21. * addIndex
  22. * addForeignKey
  23. *
  24. * Remember to call "create()" or "update()" and NOT "save()" when working
  25. * with the Table class.
  26. */
  27. public function change()
  28. {
  29. $this->table('agent_share_log')
  30. ->addColumn('root_id', 'integer', ['comment'=>'企业'])
  31. ->addColumn('employee_id', 'integer', ['comment'=>'员工'])
  32. ->addColumn('uid', 'integer', ['comment'=>'经纪人'])
  33. ->addColumn('article_id', 'integer', ['comment'=>'关联内容', 'default'=>0])
  34. ->addColumn('remarks', 'string', ['comment'=>'备注', 'default'=>''])
  35. ->addColumn('img', 'text', ['comment'=>'截图', 'null'=> true])
  36. ->addColumn('score', 'integer', ['comment'=>'获得积分', 'default'=>0])
  37. ->addColumn('status', 'integer', ['comment'=>'审核1通过2驳回', 'default'=>0])
  38. ->addColumn('addtime', 'integer', ['comment'=>'添加时间', 'default'=>0])
  39. ->addColumn('verify_time', 'integer', ['comment'=>'审核时间', 'default'=>0])
  40. ->addColumn('down_status', 'boolean', ['limit'=>2, 'comment'=>'图片的下载状态', 'default'=>0])
  41. ->addColumn('file_media_id', 'string', ['limit'=> 1000, 'comment'=> '上传腾讯的图片id数组', 'null'=> true])
  42. ->create();
  43. }
  44. }