M250605090329CreateQimallUserTeamProfitStatisticsLog.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. namespace app\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M250605090329CreateQimallUserTeamProfitStatisticsLog
  6. */
  7. class M250605090329CreateQimallUserTeamProfitStatisticsLog extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. $sql = "CREATE TABLE `qimall_user_team_profit_statistics_log` (
  15. `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  16. `mall_id` int(11) NOT NULL COMMENT '商城id',
  17. `goods_id` int(11) NOT NULL COMMENT '商品id',
  18. `order_detail_id` int(11) NOT NULL COMMENT '子订单id',
  19. `order_id` int(11) NOT NULL COMMENT '订单id',
  20. `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态(-1:删除,1:启用)',
  21. `created_at` int(11) DEFAULT NULL COMMENT '添加时间',
  22. `updated_at` int(11) DEFAULT NULL COMMENT '修改时间',
  23. PRIMARY KEY (`id`)
  24. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户团队订单利润统计记录表';";
  25. $this->execute($sql);
  26. }
  27. /**
  28. * {@inheritdoc}
  29. */
  30. public function safeDown()
  31. {
  32. echo "M250605090329CreateQimallUserTeamProfitStatisticsLog cannot be reverted.\n";
  33. return false;
  34. }
  35. /*
  36. // Use up()/down() to run migration code without a transaction.
  37. public function up()
  38. {
  39. }
  40. public function down()
  41. {
  42. echo "M250605090329CreateQimallUserTeamProfitStatisticsLog cannot be reverted.\n";
  43. return false;
  44. }
  45. */
  46. }