| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- <?php
- namespace app\migrations;
- use yii\db\Migration;
- /**
- * Class M240315014828QimallClerkLog
- */
- class M240315014828QimallClerkLog extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- $table = 'qimall_clerk_log';
- $sql="select * from information_schema.TABLES where TABLE_NAME = '{$table}';";
- $res = $this->db->createCommand($sql)->execute();
- if(!empty($res)) return '';
- $this->execute("
- CREATE TABLE `qimall_clerk_log` (
- `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
- `mall_id` int(11) NOT NULL DEFAULT '0',
- `user_id` int(11) NOT NULL DEFAULT '0' COMMENT '会员id',
- `mall_logo` varchar(255) NOT NULL DEFAULT '' COMMENT 'logo',
- `mall_name` varchar(255) NOT NULL DEFAULT '' COMMENT '商城名称或者门店名称',
- `name` varchar(255) NOT NULL DEFAULT '' COMMENT '名称',
- `pic` varchar(255) NOT NULL DEFAULT '' COMMENT '图片',
- `clerk_code` varchar(255) NOT NULL DEFAULT '' COMMENT '核销码',
- `type` tinyint(3) NOT NULL DEFAULT '1' COMMENT '核销类型:',
- `extra` mediumtext COMMENT '额外字段',
- `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态[0禁用 1启用 -1删除]',
- `created_at` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
- `updated_at` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
- PRIMARY KEY (`id`) USING BTREE
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='核销明细';
- ");
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "M240315014828QimallClerkLog cannot be reverted.\n";
- return false;
- }
- /*
- // Use up()/down() to run migration code without a transaction.
- public function up()
- {
- }
- public function down()
- {
- echo "M240315014828QimallClerkLog cannot be reverted.\n";
- return false;
- }
- */
- }
|