| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- <?php
- namespace addons\UnionPay\console\migrations;
- use yii\db\Migration;
- /**
- * Class M230423025740QimallAddonsUnionpayRequestLog
- */
- class M230423025740QimallAddonsUnionpayRequestLog extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- try {
- $table = 'qimall_addons_unionpay_request_log';
- $sql = "select * from information_schema.TABLES where TABLE_NAME = '{$table}';";
- $res = $this->db->createCommand($sql)->execute();
- if (!empty($res)) return '';
- $sql = "CREATE TABLE `qimall_addons_unionpay_request_log` (
- `id` bigint(20) NOT NULL AUTO_INCREMENT,
- `mall_id` int(10) NOT NULL COMMENT '商城ID',
- `type` varchar(255) NOT NULL DEFAULT '' COMMENT '类型',
- `out_trade_no` varchar(255) NOT NULL DEFAULT '' COMMENT '订单号',
- `oldtrxid` varchar(255) NOT NULL DEFAULT '' COMMENT '原交易的收银宝平台流水',
- `trade_type` varchar(255) NOT NULL DEFAULT '' COMMENT 'trade_type',
- `randomstr` varchar(32) NOT NULL DEFAULT '' COMMENT '随机字符',
- `request_data` longtext COMMENT '请求数据',
- `response_data` longtext COMMENT '返回数据',
- `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态',
- `updated_at` int(10) NOT NULL DEFAULT '0',
- `created_at` int(10) NOT NULL DEFAULT '0',
- PRIMARY KEY (`id`)
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='请求日志表';";
- $this->execute($sql);
- } catch (\Exception $e) {
- }
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "M230423025740QimallAddonsUnionpayRequestLog cannot be reverted.\n";
- return false;
- }
- /*
- // Use up()/down() to run migration code without a transaction.
- public function up()
- {
- }
- public function down()
- {
- echo "M230423025740QimallAddonsUnionpayRequestLog cannot be reverted.\n";
- return false;
- }
- */
- }
|