| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- <?php
- namespace app\migrations;
- use yii\db\Migration;
- /**
- * Class M240119160319CreateTableDiyTemplateOrder
- */
- class M240119160319CreateTableDiyTemplateOrder extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- try {
- $sql="CREATE TABLE `qimall_diy_template_order` (
- `id` int(10) NOT NULL AUTO_INCREMENT,
- `mall_id` int(10) NOT NULL COMMENT 'Mall id',
- `template_id` int(10) NOT NULL COMMENT '模板ID',
- `order_no` varchar(32) NOT NULL COMMENT '订单号',
- `out_trade_no` varchar(32) DEFAULT NULL COMMENT '外部订单号',
- `unit` tinyint(1) NOT NULL COMMENT '周期单位[0=永久,1=月,2=年]',
- `duration` int(10) NOT NULL COMMENT '周期时长',
- `pay_money` decimal(10,2) NOT NULL COMMENT '支付金额',
- `order_price` decimal(10,2) NOT NULL COMMENT '订单金额',
- `payment_type` tinyint(1) DEFAULT '0' COMMENT '支付方式[1=微信,2=支付宝]',
- `pay_status` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '支付状态 0 未支付 1 已支付',
- `pay_time` int(10) DEFAULT NULL COMMENT '支付时间',
- `extra_info` longtext,
- `expire_time` int(10) DEFAULT NULL COMMENT '过期时间',
- `created_at` int(10) DEFAULT NULL,
- `updated_at` int(10) DEFAULT NULL,
- PRIMARY KEY (`id`),
- KEY `mall_id` (`mall_id`),
- KEY `order_no` (`order_no`)
- ) ENGINE=InnoDB AUTO_INCREMENT=68 DEFAULT CHARSET=utf8mb4;";
- $this->execute($sql);
- } catch (\Exception $e) {
- }
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "M240119160319CreateTableDiyTemplateOrder cannot be reverted.\n";
- return false;
- }
- /*
- // Use up()/down() to run migration code without a transaction.
- public function up()
- {
- }
- public function down()
- {
- echo "M240119160319CreateTableDiyTemplateOrder cannot be reverted.\n";
- return false;
- }
- */
- }
|