diff --git a/assets/database/migrations/20230217145516_base_brand.php b/assets/database/migrations/20230217145516_base_brand.php new file mode 100644 index 00000000..477a0ce6 --- /dev/null +++ b/assets/database/migrations/20230217145516_base_brand.php @@ -0,0 +1,50 @@ +struct(); + $this->seed(); + } + + public function down(): void + { + $this->table('base_brand')->drop()->save(); + } + + private function struct(): void + { + $sql = <<<'EOT' + CREATE TABLE `base_brand` ( + `brand_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID', + `company_id` bigint(20) unsigned NOT NULL COMMENT '公司ID', + `status` enum('T','F') NOT NULL DEFAULT 'T' COMMENT '状态', + `order_num` bigint(20) unsigned NOT NULL DEFAULT '500' COMMENT '排序', + `brand_num` varchar(30) NOT NULL DEFAULT '' COMMENT '编号', + `brand_name` varchar(30) NOT NULL DEFAULT '' COMMENT '名称', + `brand_logo` varchar(130) NOT NULL DEFAULT '' COMMENT 'LOGO', + `brand_about` text NOT NULL COMMENT '介绍', + `update_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', + `create_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `brand_letter` varchar(30) NOT NULL DEFAULT '' COMMENT '品牌首字母', + `seo_keywords` varchar(30) NOT NULL COMMENT 'SEO关键字', + PRIMARY KEY (`brand_id`) USING BTREE + ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + EOT; + $this->execute($sql); + } + + private function seed(): void + { + /* + $sql = <<<'EOT' + EOT; + $this->execute($sql); + */ + } +}