M230112010757CreateTableQimallChangeMobileLog.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. namespace app\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M230112010757CreateTableQimallChangeMobileLog
  6. */
  7. class M230112010757CreateTableQimallChangeMobileLog extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. try {
  15. $sql="CREATE TABLE `qimall_change_mobile_log` (
  16. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  17. `mall_id` int(11) NOT NULL DEFAULT '0' COMMENT '商城id',
  18. `user_id` int(11) NOT NULL DEFAULT '0' COMMENT '会员id',
  19. `operator` varchar(255) NOT NULL DEFAULT '' COMMENT '操作员',
  20. `type` tinyint(3) NOT NULL DEFAULT '0' COMMENT '修改类型:1:会员修改手机号',
  21. `old_mobile` varchar(20) NOT NULL DEFAULT '' COMMENT '旧手机号',
  22. `new_mobile` varchar(20) NOT NULL DEFAULT '' COMMENT '新手机号',
  23. `created_at` int(11) NOT NULL DEFAULT '0',
  24. `updated_at` int(11) NOT NULL DEFAULT '0',
  25. PRIMARY KEY (`id`) USING BTREE
  26. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='修改手机号日志';";
  27. $this->execute($sql);
  28. }catch (\Exception $e){
  29. }
  30. }
  31. /**
  32. * {@inheritdoc}
  33. */
  34. public function safeDown()
  35. {
  36. echo "M230112010757CreateTableQimallChangeMobileLog cannot be reverted.\n";
  37. return false;
  38. }
  39. /*
  40. // Use up()/down() to run migration code without a transaction.
  41. public function up()
  42. {
  43. }
  44. public function down()
  45. {
  46. echo "M230112010757CreateTableQimallChangeMobileLog cannot be reverted.\n";
  47. return false;
  48. }
  49. */
  50. }