1
0

20230509025253_export_log.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. use think\migration\Migrator;
  3. use think\migration\db\Column;
  4. class ExportLog 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('export_log', ['comment'=>'导出记录表'])
  30. ->addColumn('root_id','integer', ['comment'=>'所属企业'])
  31. ->addColumn('file','string', ['comment'=>'导出文件'])
  32. ->addColumn('type','string', ['comment'=>'类型'])
  33. ->addColumn('employee_id','integer', ['comment'=>'操作人'])
  34. ->addColumn('search','string', ['comment'=>'查询条件'])
  35. ->addColumn('state','boolean', ['comment'=>'是否处理完毕', 'default'=>0])
  36. ->addColumn('addtime','timestamp', ['comment'=>'添加时间', 'default'=>'CURRENT_TIMESTAMP'])
  37. ->create();
  38. }
  39. }