| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- <?php
- namespace app\migrations;
- use yii\db\Migration;
- /**
- * Class M230113040014CreateTableProductDecorationTemplate
- */
- class M230113040014CreateTableProductDecorationTemplate extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- $goods_decoration_template_sql = "CREATE TABLE `qimall_goods_decoration_template` (
- `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
- `mall_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT 'Mall ID',
- `name` varchar(60) NOT NULL DEFAULT '' COMMENT '模板名称',
- `is_default` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否为默认; [0非默认, 1默认]',
- `status` tinyint(4) NOT NULL DEFAULT '1' COMMENT '状态; [-1删除, 0禁用, 1启用]',
- `template_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '商品样式id',
- `created_at` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
- `updated_at` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
- PRIMARY KEY (`id`)
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;";
- $this->execute($goods_decoration_template_sql);
- $goods_decoration_template_content_sql = "CREATE TABLE `qimall_goods_decoration_template_content` (
- `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
- `mall_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT 'Mall ID',
- `title` varchar(15) NOT NULL DEFAULT '' COMMENT '标题',
- `content` longtext COMMENT '内容',
- `status` tinyint(4) NOT NULL DEFAULT '1' COMMENT '状态; [-1删除, 0禁用, 1启用]',
- `created_at` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
- `updated_at` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
- PRIMARY KEY (`id`)
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;";
- $this->execute($goods_decoration_template_content_sql);
- $goods_template_ralation_sql = "CREATE TABLE `qimall_goods_template_relation` (
- `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
- `mall_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT 'Mall ID',
- `goods_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT 'Goods ID',
- `template_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '模板ID[qimall_goods_decoration_template主键]',
- `status` tinyint(4) NOT NULL DEFAULT '1' COMMENT '状态; [-1删除, 0禁用, 1启用]',
- `created_at` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
- `updated_at` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
- PRIMARY KEY (`id`)
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;";
- $this->execute($goods_template_ralation_sql);
- $commodity_strategy_group_insert_sql = "INSERT INTO `qimall_diy_components`(`code`, `title`, `group`, `icon`, `count`, `is_top`, `permission`, `sort`, `source`, `status`, `created_at`, `updated_at`) VALUES ('commodity-strategy-group', '商品组', 'goods_template', '', 999, 0, '{\"is_drag\":\"true\",\"is_up\":\"true\",\"id_down\":\"true\",\"is_copy\":\"true\"}', 999, '', 1, 1634538238, 1634538238);";
- $this->execute($commodity_strategy_group_insert_sql);
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
-
- }
- }
|