20230731074850_create_smart_screen_import_table.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. use think\migration\Migrator;
  3. use think\migration\db\Column;
  4. class CreateSmartScreenImportTable 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('smart_screen_import_log')->setComment('智慧屏资料导入记录')
  30. ->addColumn('name', 'string', ['limit'=> 200, 'default'=> '', 'comment'=> '导入文件名'])
  31. ->addColumn('type', 'integer', ['limit'=> 2, 'default'=> 0, 'comment'=> '1、在施工地2、项目清单'])
  32. ->addColumn('count', 'integer', ['limit'=> 10, 'default'=> 0, 'comment'=> '资源条数'])
  33. ->addColumn('valid_count', 'integer', ['limit'=> 10, 'default'=> 0, 'comment'=> '有效数量'])
  34. ->addColumn('invalid_count', 'integer', ['limit'=> 10, 'default'=> 0, 'comment'=> '无效数量'])
  35. ->addColumn('status', 'integer', ['limit'=> 1, 'default'=> 0, 'comment'=> '导入状态 0、未开始 1、进行中2、完成'])
  36. ->addColumn('employee_id', 'integer', ['limit'=> 10, 'default'=> 0, 'comment'=> '导入人'])
  37. ->addColumn('root_id', 'integer', ['limit'=> '10', 'default'=> 0, 'comment'=> '企业id'])
  38. ->addColumn('execute_rows', 'integer', ['limit'=> 10, 'default'=> 0, 'comment'=> '执行行数'])
  39. ->addColumn('tmp_path', 'string', ['limit'=> 255, 'default'=> '', 'comment'=> '临时文件路径'])
  40. ->addColumn('path', 'string', ['limit'=> 255, 'default'=> '', 'comment'=> '文件路径'])
  41. ->create();
  42. }
  43. }