20230319091406_create_customer_invalid_log_table.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. use think\migration\Migrator;
  3. use think\migration\db\Column;
  4. class CreateCustomerInvalidLogTable 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. $table = $this->table('customer_invalid_log', ['comment'=> '客户置为无效记录表']);
  30. $table->addColumn('customer_id', 'integer', ['limit'=> 11, 'default'=> 0, 'comment'=> '客户id'])
  31. ->addColumn('employee_id', 'integer', ['limit'=> 11, 'default'=> 0, 'comment'=> '员工id(置为无效时的员工id)'])
  32. ->addColumn('designer_id', 'integer', ['limit'=> 11, 'default'=> 0, 'comment'=> '设计师id(置为无效时的设计师id)'])
  33. ->addColumn('org_id', 'integer', ['limit'=> 11, 'default'=> 0, 'comment'=> '部门id(置为无效时的部门id)'])
  34. ->addColumn('root_id', 'integer', ['limit'=> 11, 'default'=> 0, 'comment'=> '企业id(置为无效时的部门id)'])
  35. ->addColumn('cus_addtime', 'timestamp', ['default'=> 'CURRENT_TIMESTAMP', 'comment'=> '客户的添加时间(置为无效时的客户的添加时间)'])
  36. ->addColumn('visitlog_id', 'integer', ['limit'=> 11, 'default'=> 0, 'comment'=> '置为无效时的记录表id'])
  37. ->addColumn('addtime', 'timestamp', ['default'=> 'CURRENT_TIMESTAMP', 'comment'=> '记录添加时间'])
  38. ->addColumn('assigned_personnel', 'string', ['limit'=> 255, 'default'=> '', 'comment'=> '内容'])
  39. ->addColumn('source_id', 'integer', ['limit'=> 11, 'default'=> 0, 'comment'=> '置为无效时客户的来源id'])
  40. ->create();
  41. }
  42. }