20220118052332_pluginAliSms.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. use think\migration\Migrator;
  3. class PluginAliSms extends Migrator
  4. {
  5. public function change()
  6. {
  7. $table = $this->table('plugin_ali_sms', [
  8. 'engine' => 'InnoDB',
  9. 'comment' => '阿里云手机短信管理',
  10. 'collation' => 'utf8mb4_general_ci',
  11. ]);
  12. //删除表
  13. if ($table->exists()) {
  14. $table->drop();
  15. }
  16. $table
  17. ->addColumn('template_code', 'string', ['limit' => 255, 'default' => '', 'comment' => '阿里云短信模板ID'])
  18. ->addColumn('event', 'string', ['limit' => 255, 'default' => '', 'comment' => '事件名称'])
  19. ->addColumn('params', 'text', ['comment' => '短信内容参数'])
  20. ->addColumn('mobile', 'string', ['limit' => 255, 'default' => '', 'comment' => '收信人手机号码'])
  21. ->addColumn('status', 'boolean', ['limit' => 4, 'default' => '0', 'comment' => '状态。1=未使用,2=已使用,3=已过期,默认:1'])
  22. ->addColumn('expire_time', 'integer', ['limit' => 11, 'default' => '0', 'comment' => '过期时间,0表示永不过期'])
  23. ->addColumn('create_time', 'datetime', ['null' => 1, 'comment' => '创建时间'])
  24. ->addColumn('update_time', 'datetime', ['null' => 1, 'comment' => '更新时间'])
  25. ->addColumn('delete_time', 'datetime', ['null' => 1, 'comment' => '删除时间'])
  26. ;
  27. $table->create();
  28. }
  29. }