base.lt 473 B

1234567891011121314151617181920212223242526
  1. <?php
  2. use think\migration\Migrator;
  3. class {%className%} extends Migrator
  4. {
  5. public function change()
  6. {
  7. $table = $this->table('{%tableName%}', [
  8. 'engine' => '{%engine%}',
  9. 'comment' => '{%tableComment%}',
  10. 'collation' => '{%collation%}'
  11. ]);
  12. //删除表
  13. if ($table->exists()) {
  14. $table->drop();
  15. }
  16. $table
  17. {%fields%}
  18. ;
  19. $table->create();
  20. }
  21. }