20230214080415_create_vr_floder.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. use think\migration\Migrator;
  3. use think\migration\db\Column;
  4. class CreateVrFloder 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('vr_floder', ['comment' => 'vr文件夹'])
  30. ->addColumn('fld_name', 'string', ['comment' => '文件夹名'])
  31. ->addColumn('createtime', 'integer', ['comment' => '创建时间'])
  32. ->addColumn('vr_num', 'integer', ['comment' => 'vr数量', 'default' => 0])
  33. ->addColumn('fld_type', 'boolean', ['comment' => '文件夹类型(1个人2团队)', 'default' => 1])
  34. ->addColumn('create_user', 'integer', ['comment' => '文件夹创建人'])
  35. ->addColumn('lft', 'string', ['comment' => '二叉树左侧数'])
  36. ->addColumn('rgt', 'string', ['comment' => '二叉树右侧数'])
  37. ->addColumn('depth', 'boolean', ['comment' => '层级深度', 'default' => 1])
  38. ->addColumn('root_id', 'integer', ['comment' => '团队id', 'null' => true, 'default' => 0])
  39. ->create();
  40. }
  41. }