From 19dd2f75d8d4f5fecb2f1f007da11e7956fb249a Mon Sep 17 00:00:00 2001 From: Edward Yang Date: Thu, 1 Sep 2022 18:16:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=88=E5=B9=B6migrations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../2021_12_26_111435_create_tables.php | 344 ++++++++++++++++-- ...022_06_23_075504_create_customer_table.php | 63 ---- .../2022_06_28_065137_create_address.php | 42 --- .../2022_06_30_071925_country_zone.php | 45 --- .../migrations/2022_06_30_085304_currency.php | 38 -- .../2022_07_01_061732_create_plugins.php | 33 -- ...2022_07_04_065314_add_cart_item_orders.php | 96 ----- ...022_07_05_082744_create_language_table.php | 37 -- .../2022_07_07_032305_verify_code.php | 34 -- .../migrations/2022_07_14_103842_wishlist.php | 33 -- .../2022_07_21_073835_create_tax.php | 69 ---- .../2022_07_22_013834_add_order_totals.php | 36 -- ...022_07_26_073911_create_product_images.php | 42 --- ...2022_07_27_123325_create_manufacturers.php | 42 --- .../2022_07_29_021003_return_table.php | 60 --- ..._07_29_063112_add_product_tax_class_id.php | 30 -- .../2022_08_08_071126_crate_page.php | 45 --- .../2022_08_08_094745_order_history.php | 34 -- 18 files changed, 321 insertions(+), 802 deletions(-) delete mode 100644 database/migrations/2022_06_23_075504_create_customer_table.php delete mode 100644 database/migrations/2022_06_28_065137_create_address.php delete mode 100644 database/migrations/2022_06_30_071925_country_zone.php delete mode 100644 database/migrations/2022_06_30_085304_currency.php delete mode 100644 database/migrations/2022_07_01_061732_create_plugins.php delete mode 100644 database/migrations/2022_07_04_065314_add_cart_item_orders.php delete mode 100644 database/migrations/2022_07_05_082744_create_language_table.php delete mode 100644 database/migrations/2022_07_07_032305_verify_code.php delete mode 100644 database/migrations/2022_07_14_103842_wishlist.php delete mode 100644 database/migrations/2022_07_21_073835_create_tax.php delete mode 100644 database/migrations/2022_07_22_013834_add_order_totals.php delete mode 100644 database/migrations/2022_07_26_073911_create_product_images.php delete mode 100644 database/migrations/2022_07_27_123325_create_manufacturers.php delete mode 100644 database/migrations/2022_07_29_021003_return_table.php delete mode 100644 database/migrations/2022_07_29_063112_add_product_tax_class_id.php delete mode 100644 database/migrations/2022_08_08_071126_crate_page.php delete mode 100644 database/migrations/2022_08_08_094745_order_history.php diff --git a/database/migrations/2021_12_26_111435_create_tables.php b/database/migrations/2021_12_26_111435_create_tables.php index e94e6f88..d3acc254 100644 --- a/database/migrations/2021_12_26_111435_create_tables.php +++ b/database/migrations/2021_12_26_111435_create_tables.php @@ -13,6 +13,23 @@ class CreateTables extends Migration */ public function up() { + Schema::create('addresses', function (Blueprint $table) { + $table->id(); + $table->unsignedInteger('customer_id'); + $table->string('name'); + $table->string('phone'); + $table->unsignedInteger('country_id'); + $table->unsignedInteger('zone_id'); + $table->string('zone'); + $table->unsignedInteger('city_id')->nullable(); + $table->string('city'); + $table->string('zipcode'); + $table->string('address_1'); + $table->string('address_2'); + $table->timestamps(); + }); + + Schema::create('admin_users', function (Blueprint $table) { $table->id(); $table->string('name'); @@ -23,6 +40,38 @@ class CreateTables extends Migration $table->timestamps(); }); + + Schema::create('brands', function (Blueprint $table) { + $table->id(); + $table->string('name'); + $table->char('first'); + $table->string('logo'); + $table->integer('sort_order'); + $table->integer('status'); + $table->timestamps(); + }); + + + Schema::create('carts', function (Blueprint $table) { + $table->id(); + $table->integer('customer_id'); + $table->integer('shipping_address_id'); + $table->string('shipping_method_code'); + $table->integer('payment_address_id'); + $table->string('payment_method_code'); + $table->timestamps(); + }); + Schema::create('cart_products', function (Blueprint $table) { + $table->id(); + $table->integer('customer_id'); + $table->boolean('selected'); + $table->integer('product_id'); + $table->integer('product_sku_id'); + $table->unsignedInteger('quantity'); + $table->timestamps(); + }); + + Schema::create('categories', function (Blueprint $table) { $table->id()->startingValue(100_000); $table->unsignedBigInteger('parent_id')->default(0); @@ -30,7 +79,6 @@ class CreateTables extends Migration $table->boolean('active'); $table->timestamps(); }); - Schema::create('category_descriptions', function (Blueprint $table) { $table->id(); $table->unsignedBigInteger('category_id'); @@ -42,7 +90,6 @@ class CreateTables extends Migration $table->string('meta_keyword')->default(''); $table->timestamps(); }); - Schema::create('category_paths', function (Blueprint $table) { $table->id(); $table->unsignedBigInteger('category_id'); @@ -51,25 +98,201 @@ class CreateTables extends Migration $table->timestamps(); }); + + Schema::create('countries', function (Blueprint $table) { + $table->id(); + $table->string('name', 64); + $table->string('code', 16); + $table->integer('sort_order'); + $table->tinyInteger('status'); + $table->timestamps(); + }); + + + Schema::create('currencies', function (Blueprint $table) { + $table->id(); + $table->string('name', 64); + $table->string('code', 16); + $table->string('symbol_left', 16); + $table->string('symbol_right', 16); + $table->char('decimal_place', 1); + $table->double('value', 15, 8); + $table->tinyInteger('status'); + $table->timestamps(); + }); + + + Schema::create('customers', function (Blueprint $table) { + $table->id(); + $table->string('email')->unique(); + $table->string('password'); + $table->string('name'); + $table->string('avatar')->default(''); + $table->unsignedInteger('customer_group_id'); + $table->unsignedInteger('address_id')->default(0); + $table->string('locale', 10); + $table->tinyInteger('status')->default(0); + $table->string('code', 40)->default(''); + $table->string('from', 16)->default(''); + $table->softDeletes(); + $table->timestamps(); + }); + Schema::create('customer_groups', function (Blueprint $table) { + $table->id(); + $table->decimal('total', 12, 4); + $table->decimal('reward_point_factor', 12, 4); + $table->decimal('use_point_factor', 12, 4); + $table->decimal('discount_factor', 12, 4); + $table->integer('level'); + $table->timestamps(); + }); + Schema::create('customer_group_descriptions', function (Blueprint $table) { + $table->id(); + $table->unsignedInteger('customer_group_id'); + $table->string('locale', 10); + $table->string('name', 256); + $table->text('description'); + $table->timestamps(); + }); + Schema::create('customer_wishlists', function (Blueprint $table) { + $table->id(); + $table->unsignedInteger('customer_id'); + $table->unsignedInteger('product_id'); + $table->timestamps(); + }); + + + Schema::create('languages', function (Blueprint $table) { + $table->id(); + $table->string('name', 64); + $table->string('code', 16); + $table->string('locale', 255); + $table->string('image', 255); + $table->integer('sort_order'); + $table->tinyInteger('status'); + $table->timestamps(); + }); + + + Schema::create('orders', function (Blueprint $table) { + $table->id(); + $table->string('number'); + $table->integer('customer_id'); + $table->integer('customer_group_id'); + $table->integer('shipping_address_id'); + $table->integer('payment_address_id'); + $table->string('customer_name'); + $table->string('email'); + $table->integer('calling_code'); + $table->string('telephone'); + $table->decimal('total', 16, 4); + $table->string('locale'); + $table->string('currency_code'); + $table->string('currency_value'); + $table->string('ip'); + $table->string('user_agent'); + $table->string('status'); + $table->string('shipping_method_code'); + $table->string('shipping_method_name'); + $table->string('shipping_customer_name'); + $table->string('shipping_calling_code'); + $table->string('shipping_telephone'); + $table->string('shipping_country'); + $table->string('shipping_zone'); + $table->string('shipping_city'); + $table->string('shipping_address_1'); + $table->string('shipping_address_2'); + $table->string('payment_method_code'); + $table->string('payment_method_name'); + $table->string('payment_customer_name'); + $table->string('payment_calling_code'); + $table->string('payment_telephone'); + $table->string('payment_country'); + $table->string('payment_zone'); + $table->string('payment_city'); + $table->string('payment_address_1'); + $table->string('payment_address_2'); + $table->timestamps(); + $table->softDeletes(); + }); + Schema::create('order_products', function (Blueprint $table) { + $table->id(); + $table->integer('order_id'); + $table->integer('product_id'); + $table->string('order_number'); + $table->string('product_sku'); + $table->string('name'); + $table->string('image'); + $table->integer('quantity'); + $table->decimal('price', 16, 4); + $table->timestamps(); + $table->softDeletes(); + }); + Schema::create('order_histories', function (Blueprint $table) { + $table->id(); + $table->integer('order_id'); + $table->string('status'); + $table->boolean('notify'); + $table->text('comment'); + $table->timestamps(); + }); + Schema::create('order_totals', function (Blueprint $table) { + $table->id(); + $table->integer('order_id'); + $table->string('code'); + $table->string('value'); + $table->string('title'); + $table->json('reference'); + $table->timestamps(); + }); + + + Schema::create('pages', function (Blueprint $table) { + $table->id(); + $table->integer('position'); + $table->boolean('active'); + $table->timestamps(); + }); + Schema::create('page_descriptions', function (Blueprint $table) { + $table->id(); + $table->integer('page_id'); + $table->string('locale'); + $table->string('title'); + $table->text('content'); + $table->string('meta_title'); + $table->string('meta_description'); + $table->string('meta_keyword'); + $table->timestamps(); + }); + + + Schema::create('plugins', function (Blueprint $table) { + $table->id(); + $table->string('type')->comment('类型: shipping, payment'); + $table->string('code')->comment('唯一标识'); + $table->timestamps(); + }); + + Schema::create('products', function (Blueprint $table) { $table->id()->startingValue(100_000); - $table->string('image')->default(''); + $table->unsignedInteger('brand_id')->index(); + $table->json('images')->nullable(); $table->decimal('price')->default(0); $table->string('video')->default(''); $table->integer('position')->default(0); $table->boolean('active')->default(0); $table->json('variables')->nullable(); + $table->integer('tax_class_id')->default(0); $table->timestamps(); $table->softDeletes(); }); - Schema::create('product_categories', function (Blueprint $table) { $table->id(); $table->unsignedBigInteger('product_id'); $table->unsignedBigInteger('category_id'); $table->timestamps(); }); - Schema::create('product_descriptions', function (Blueprint $table) { $table->id(); $table->unsignedBigInteger('product_id'); @@ -81,13 +304,12 @@ class CreateTables extends Migration $table->string('meta_keyword')->default(''); $table->timestamps(); }); - Schema::create('product_skus', function (Blueprint $table) { $table->id()->startingValue(100_000); $table->unsignedBigInteger('product_id'); $table->json('variants')->nullable(); $table->integer('position')->default(0); - $table->string('image')->default(''); + $table->json('images')->nullable(); $table->string('model')->default(''); $table->string('sku')->default(''); $table->double('price')->default(0); @@ -98,15 +320,56 @@ class CreateTables extends Migration $table->timestamps(); }); - Schema::create('carts', function (Blueprint $table) { + + // 区域组, 比如江浙沪, 中国西部 + Schema::create('regions', function (Blueprint $table) { $table->id(); - $table->integer('customer_id'); - $table->boolean('selected'); - $table->integer('product_id'); - $table->integer('product_sku_id'); - $table->unsignedInteger('quantity'); + $table->string('name'); + $table->string('description'); $table->timestamps(); }); + // 区域组与国家省市县关联表 + Schema::create('region_zones', function (Blueprint $table) { + $table->id(); + $table->integer('region_id'); + $table->integer('country_id'); + $table->integer('zone_id'); + $table->timestamps(); + }); + + + Schema::create('rmas', function (Blueprint $table) { + $table->id(); + $table->unsignedInteger('order_id'); + $table->unsignedInteger('order_product_id'); + $table->unsignedInteger('customer_id'); + $table->string('name'); + $table->string('email'); + $table->string('telephone'); + $table->string('product_name'); + $table->string('sku'); + $table->integer('quantity'); + $table->tinyInteger('opened'); + $table->unsignedInteger('rma_reason_id'); + $table->string('type'); // 售后服务类型:退货、换货、维修、补发商品、仅退款 + $table->string('status'); // + $table->text('comment'); + $table->timestamps(); + }); + Schema::create('rma_histories', function (Blueprint $table) { + $table->id(); + $table->unsignedInteger('rma_id'); + $table->string('status'); + $table->tinyInteger('notify'); + $table->text('comment'); + $table->timestamps(); + }); + Schema::create('rma_reasons', function (Blueprint $table) { + $table->id(); + $table->json('name'); // 值示例: {"en":"cannot to use","zh_cn":"无法使用"} + $table->timestamps(); + }); + Schema::create('settings', function (Blueprint $table) { $table->id(); @@ -117,6 +380,50 @@ class CreateTables extends Migration $table->boolean('json')->default(false); $table->timestamps(); }); + + + Schema::create('tax_classes', function (Blueprint $table) { + $table->id(); + $table->string('title'); + $table->string('description'); + $table->timestamps(); + }); + Schema::create('tax_rates', function (Blueprint $table) { + $table->id(); + $table->integer('region_id'); + $table->string('name'); + $table->string('rate'); + $table->enum('type', ['percent', 'flat']); + $table->timestamps(); + }); + Schema::create('tax_rules', function (Blueprint $table) { + $table->id(); + $table->integer('tax_class_id'); + $table->integer('tax_rate_id'); + $table->enum('based', ['store', 'payment', 'shipping']); + $table->integer('priority'); + $table->timestamps(); + }); + + + Schema::create('verify_codes', function (Blueprint $table) { + $table->id(); + $table->string('account', 256); + $table->string('code', 16); + $table->softDeletes(); + $table->timestamps(); + }); + + + Schema::create('zones', function (Blueprint $table) { + $table->id(); + $table->unsignedInteger('country_id'); + $table->string('name', 64); + $table->string('code', 16); + $table->integer('sort_order'); + $table->tinyInteger('status'); + $table->timestamps(); + }); } /** @@ -126,15 +433,6 @@ class CreateTables extends Migration */ public function down() { - Schema::dropIfExists('admin_users'); - Schema::dropIfExists('categories'); - Schema::dropIfExists('category_descriptions'); - Schema::dropIfExists('category_paths'); - Schema::dropIfExists('products'); - Schema::dropIfExists('product_categories'); - Schema::dropIfExists('product_descriptions'); - Schema::dropIfExists('product_skus'); - Schema::dropIfExists('carts'); - Schema::dropIfExists('settings'); + } } diff --git a/database/migrations/2022_06_23_075504_create_customer_table.php b/database/migrations/2022_06_23_075504_create_customer_table.php deleted file mode 100644 index 35554a6f..00000000 --- a/database/migrations/2022_06_23_075504_create_customer_table.php +++ /dev/null @@ -1,63 +0,0 @@ -id(); - $table->string('email')->unique(); - $table->string('password'); - $table->string('name'); - $table->string('avatar')->default(''); - $table->unsignedInteger('customer_group_id'); - $table->unsignedInteger('address_id')->default(0); - $table->string('locale', 10); - $table->tinyInteger('status')->default(0); - $table->string('code', 40)->default(''); - $table->string('from', 16)->default(''); - $table->softDeletes(); - $table->timestamps(); - }); - - Schema::create('customer_groups', function (Blueprint $table) { - $table->id(); - $table->decimal('total', 12, 4); - $table->decimal('reward_point_factor', 12, 4); - $table->decimal('use_point_factor', 12, 4); - $table->decimal('discount_factor', 12, 4); - $table->integer('level'); - $table->timestamps(); - }); - - Schema::create('customer_group_descriptions', function (Blueprint $table) { - $table->id(); - $table->unsignedInteger('customer_group_id'); - $table->string('locale', 10); - $table->string('name', 256); - $table->text('description'); - $table->timestamps(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('customers'); - Schema::dropIfExists('customer_groups'); - Schema::dropIfExists('customer_group_descriptions'); - } -} diff --git a/database/migrations/2022_06_28_065137_create_address.php b/database/migrations/2022_06_28_065137_create_address.php deleted file mode 100644 index 6823aed3..00000000 --- a/database/migrations/2022_06_28_065137_create_address.php +++ /dev/null @@ -1,42 +0,0 @@ -id(); - $table->unsignedInteger('customer_id'); - $table->string('name'); - $table->string('phone'); - $table->unsignedInteger('country_id'); - $table->unsignedInteger('zone_id'); - $table->string('zone'); - $table->unsignedInteger('city_id')->nullable(); - $table->string('city'); - $table->string('zipcode'); - $table->string('address_1'); - $table->string('address_2'); - $table->timestamps(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('address'); - } -} diff --git a/database/migrations/2022_06_30_071925_country_zone.php b/database/migrations/2022_06_30_071925_country_zone.php deleted file mode 100644 index f4f1f8d6..00000000 --- a/database/migrations/2022_06_30_071925_country_zone.php +++ /dev/null @@ -1,45 +0,0 @@ -id(); - $table->string('name', 64); - $table->string('code', 16); - $table->integer('sort_order'); - $table->tinyInteger('status'); - $table->timestamps(); - }); - Schema::create('zones', function (Blueprint $table) { - $table->id(); - $table->unsignedInteger('country_id'); - $table->string('name', 64); - $table->string('code', 16); - $table->integer('sort_order'); - $table->tinyInteger('status'); - $table->timestamps(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('countries'); - Schema::dropIfExists('zones'); - } -} diff --git a/database/migrations/2022_06_30_085304_currency.php b/database/migrations/2022_06_30_085304_currency.php deleted file mode 100644 index b2c35aea..00000000 --- a/database/migrations/2022_06_30_085304_currency.php +++ /dev/null @@ -1,38 +0,0 @@ -id(); - $table->string('name', 64); - $table->string('code', 16); - $table->string('symbol_left', 16); - $table->string('symbol_right', 16); - $table->char('decimal_place', 1); - $table->double('value', 15, 8); - $table->tinyInteger('status'); - $table->timestamps(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('currencies'); - } -} diff --git a/database/migrations/2022_07_01_061732_create_plugins.php b/database/migrations/2022_07_01_061732_create_plugins.php deleted file mode 100644 index 4b8a6b37..00000000 --- a/database/migrations/2022_07_01_061732_create_plugins.php +++ /dev/null @@ -1,33 +0,0 @@ -id(); - $table->string('type')->comment('类型: shipping, payment'); - $table->string('code')->comment('唯一标识'); - $table->timestamps(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('plugins'); - } -} diff --git a/database/migrations/2022_07_04_065314_add_cart_item_orders.php b/database/migrations/2022_07_04_065314_add_cart_item_orders.php deleted file mode 100644 index c69dfb90..00000000 --- a/database/migrations/2022_07_04_065314_add_cart_item_orders.php +++ /dev/null @@ -1,96 +0,0 @@ -id(); - $table->integer('customer_id'); - $table->integer('shipping_address_id'); - $table->string('shipping_method_code'); - $table->integer('payment_address_id'); - $table->string('payment_method_code'); - $table->timestamps(); - }); - - - Schema::create('orders', function (Blueprint $table) { - $table->id(); - $table->string('number'); - $table->integer('customer_id'); - $table->integer('customer_group_id'); - $table->integer('shipping_address_id'); - $table->integer('payment_address_id'); - $table->string('customer_name'); - $table->string('email'); - $table->integer('calling_code'); - $table->string('telephone'); - $table->decimal('total', 16, 4); - $table->string('locale'); - $table->string('currency_code'); - $table->string('currency_value'); - $table->string('ip'); - $table->string('user_agent'); - $table->string('status'); - $table->string('shipping_method_code'); - $table->string('shipping_method_name'); - $table->string('shipping_customer_name'); - $table->string('shipping_calling_code'); - $table->string('shipping_telephone'); - $table->string('shipping_country'); - $table->string('shipping_zone'); - $table->string('shipping_city'); - $table->string('shipping_address_1'); - $table->string('shipping_address_2'); - $table->string('payment_method_code'); - $table->string('payment_method_name'); - $table->string('payment_customer_name'); - $table->string('payment_calling_code'); - $table->string('payment_telephone'); - $table->string('payment_country'); - $table->string('payment_zone'); - $table->string('payment_city'); - $table->string('payment_address_1'); - $table->string('payment_address_2'); - $table->timestamps(); - $table->softDeletes(); - }); - - Schema::create('order_products', function (Blueprint $table) { - $table->id(); - $table->integer('order_id'); - $table->integer('product_id'); - $table->string('order_number'); - $table->string('product_sku'); - $table->string('name'); - $table->string('image'); - $table->integer('quantity'); - $table->decimal('price', 16, 4); - $table->timestamps(); - $table->softDeletes(); - }); - - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - // - } -} diff --git a/database/migrations/2022_07_05_082744_create_language_table.php b/database/migrations/2022_07_05_082744_create_language_table.php deleted file mode 100644 index aa427358..00000000 --- a/database/migrations/2022_07_05_082744_create_language_table.php +++ /dev/null @@ -1,37 +0,0 @@ -id(); - $table->string('name', 64); - $table->string('code', 16); - $table->string('locale', 255); - $table->string('image', 255); - $table->integer('sort_order'); - $table->tinyInteger('status'); - $table->timestamps(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('languages'); - } -} diff --git a/database/migrations/2022_07_07_032305_verify_code.php b/database/migrations/2022_07_07_032305_verify_code.php deleted file mode 100644 index f31aa07c..00000000 --- a/database/migrations/2022_07_07_032305_verify_code.php +++ /dev/null @@ -1,34 +0,0 @@ -id(); - $table->string('account', 256); - $table->string('code', 16); - $table->softDeletes(); - $table->timestamps(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('verify_codes'); - } -} diff --git a/database/migrations/2022_07_14_103842_wishlist.php b/database/migrations/2022_07_14_103842_wishlist.php deleted file mode 100644 index 07b0d10a..00000000 --- a/database/migrations/2022_07_14_103842_wishlist.php +++ /dev/null @@ -1,33 +0,0 @@ -id(); - $table->unsignedInteger('customer_id'); - $table->unsignedInteger('product_id'); - $table->timestamps(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('customer_wishlists'); - } -} diff --git a/database/migrations/2022_07_21_073835_create_tax.php b/database/migrations/2022_07_21_073835_create_tax.php deleted file mode 100644 index 95555465..00000000 --- a/database/migrations/2022_07_21_073835_create_tax.php +++ /dev/null @@ -1,69 +0,0 @@ -id(); - $table->string('name'); - $table->string('description'); - $table->timestamps(); - }); - - // 区域组与国家省市县关联表 - Schema::create('region_zones', function (Blueprint $table) { - $table->id(); - $table->integer('region_id'); - $table->integer('country_id'); - $table->integer('zone_id'); - $table->timestamps(); - }); - - - Schema::create('tax_classes', function (Blueprint $table) { - $table->id(); - $table->string('title'); - $table->string('description'); - $table->timestamps(); - }); - - Schema::create('tax_rates', function (Blueprint $table) { - $table->id(); - $table->integer('region_id'); - $table->string('name'); - $table->string('rate'); - $table->enum('type', ['percent', 'flat']); - $table->timestamps(); - }); - - Schema::create('tax_rules', function (Blueprint $table) { - $table->id(); - $table->integer('tax_class_id'); - $table->integer('tax_rate_id'); - $table->enum('based', ['store', 'payment', 'shipping']); - $table->integer('priority'); - $table->timestamps(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - - } -} diff --git a/database/migrations/2022_07_22_013834_add_order_totals.php b/database/migrations/2022_07_22_013834_add_order_totals.php deleted file mode 100644 index d856a66b..00000000 --- a/database/migrations/2022_07_22_013834_add_order_totals.php +++ /dev/null @@ -1,36 +0,0 @@ -id(); - $table->integer('order_id'); - $table->string('code'); - $table->string('value'); - $table->string('title'); - $table->json('reference'); - $table->timestamps(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - // - } -} diff --git a/database/migrations/2022_07_26_073911_create_product_images.php b/database/migrations/2022_07_26_073911_create_product_images.php deleted file mode 100644 index d8d9f332..00000000 --- a/database/migrations/2022_07_26_073911_create_product_images.php +++ /dev/null @@ -1,42 +0,0 @@ -dropColumn('image'); - $table->json('images')->nullable(); - }); - Schema::table('product_skus', function (Blueprint $table) { - $table->dropColumn('image'); - $table->json('images')->nullable(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::table('products', function (Blueprint $table) { - $table->dropColumn('images'); - $table->string('image')->default(''); - }); - Schema::table('product_skus', function (Blueprint $table) { - $table->dropColumn('images'); - $table->string('image')->default(''); - }); - } -} diff --git a/database/migrations/2022_07_27_123325_create_manufacturers.php b/database/migrations/2022_07_27_123325_create_manufacturers.php deleted file mode 100644 index cb9816d7..00000000 --- a/database/migrations/2022_07_27_123325_create_manufacturers.php +++ /dev/null @@ -1,42 +0,0 @@ -id(); - $table->string('name'); - $table->char('first'); - $table->string('logo'); - $table->integer('sort_order'); - $table->integer('status'); - $table->timestamps(); - }); - Schema::table('products', function (Blueprint $table) { - $table->unsignedInteger('brand_id')->after('id')->index(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('brands'); - Schema::table('products', function (Blueprint $table) { - $table->dropColumn('brand_id'); - }); - } -} diff --git a/database/migrations/2022_07_29_021003_return_table.php b/database/migrations/2022_07_29_021003_return_table.php deleted file mode 100644 index bca46bc0..00000000 --- a/database/migrations/2022_07_29_021003_return_table.php +++ /dev/null @@ -1,60 +0,0 @@ -id(); - $table->unsignedInteger('order_id'); - $table->unsignedInteger('order_product_id'); - $table->unsignedInteger('customer_id'); - $table->string('name'); - $table->string('email'); - $table->string('telephone'); - $table->string('product_name'); - $table->string('sku'); - $table->integer('quantity'); - $table->tinyInteger('opened'); - $table->unsignedInteger('rma_reason_id'); - $table->string('type'); // 售后服务类型:退货、换货、维修、补发商品、仅退款 - $table->string('status'); // - $table->text('comment'); - $table->timestamps(); - }); - Schema::create('rma_histories', function (Blueprint $table) { - $table->id(); - $table->unsignedInteger('rma_id'); - $table->string('status'); - $table->tinyInteger('notify'); - $table->text('comment'); - $table->timestamps(); - }); - Schema::create('rma_reasons', function (Blueprint $table) { - $table->id(); - $table->json('name'); // 值示例: {"en":"cannot to use","zh_cn":"无法使用"} - $table->timestamps(); - }); - } - - /** - * Reverse the migrations. - * - * @rma void - */ - public function down() - { - Schema::dropIfExists('rmas'); - Schema::dropIfExists('rma_histories'); - Schema::dropIfExists('rma_reasons'); - } -} diff --git a/database/migrations/2022_07_29_063112_add_product_tax_class_id.php b/database/migrations/2022_07_29_063112_add_product_tax_class_id.php deleted file mode 100644 index dec3149c..00000000 --- a/database/migrations/2022_07_29_063112_add_product_tax_class_id.php +++ /dev/null @@ -1,30 +0,0 @@ -integer('tax_class_id')->after('variables'); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - // - } -} diff --git a/database/migrations/2022_08_08_071126_crate_page.php b/database/migrations/2022_08_08_071126_crate_page.php deleted file mode 100644 index 294aef28..00000000 --- a/database/migrations/2022_08_08_071126_crate_page.php +++ /dev/null @@ -1,45 +0,0 @@ -id(); - $table->integer('position'); - $table->boolean('active'); - $table->timestamps(); - }); - - Schema::create('page_descriptions', function (Blueprint $table) { - $table->id(); - $table->integer('page_id'); - $table->string('locale'); - $table->string('title'); - $table->text('content'); - $table->string('meta_title'); - $table->string('meta_description'); - $table->string('meta_keyword'); - $table->timestamps(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - // - } -}; diff --git a/database/migrations/2022_08_08_094745_order_history.php b/database/migrations/2022_08_08_094745_order_history.php deleted file mode 100644 index fabca246..00000000 --- a/database/migrations/2022_08_08_094745_order_history.php +++ /dev/null @@ -1,34 +0,0 @@ -id(); - $table->integer('order_id'); - $table->string('status'); - $table->boolean('notify'); - $table->text('comment'); - $table->timestamps(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - // - } -};