20221007020243_create_customer_not_visit_table.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. use think\migration\Migrator;
  3. use think\migration\db\Column;
  4. class CreateCustomerNotVisitTable 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('customer_not_visit', ['comment'=>'预约未回访数据'])
  30. ->addColumn('customer_id', 'integer', ['comment' => '客户id'])
  31. ->addColumn('employee_id', 'integer', ['comment' => '跟进人id'])
  32. ->addColumn('org_id', 'integer', ['comment' => '客户所属部门(非设计师或跟进人部门)'])
  33. ->addColumn('designer_id', 'integer', ['comment' => '设计师', 'null' => true])
  34. ->addColumn('appoint_date', 'date', ['comment' => '预约时间'])
  35. ->addColumn('state', 'string', ['comment' => '状态', 'null'=>true])
  36. ->addColumn('addtime', 'timestamp', ['comment' => '添加时间', 'default' => 'CURRENT_TIMESTAMP'])
  37. ->create();
  38. }
  39. }