diff --git a/database/migrations/2022_07_21_073835_create_tax.php b/database/migrations/2022_07_21_073835_create_tax.php new file mode 100644 index 00000000..b481d241 --- /dev/null +++ b/database/migrations/2022_07_21_073835_create_tax.php @@ -0,0 +1,68 @@ +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->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + + } +}