user shops + shipping
This commit is contained in:
parent
ccc2af4bf7
commit
d4f6a774d0
53 changed files with 2326 additions and 814 deletions
|
|
@ -31,6 +31,9 @@ class CreateProductsTable extends Migration
|
|||
|
||||
$table->decimal('price_old', 8, 2)->nullable(); //streichpreis
|
||||
|
||||
$table->unsignedInteger('weight')->nullable();
|
||||
|
||||
|
||||
$table->string('contents')->nullable();
|
||||
$table->string('number')->nullable();
|
||||
$table->string('icons')->nullable(); //as array cast
|
||||
|
|
|
|||
|
|
@ -0,0 +1,39 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateShippingsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('shippings', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
|
||||
$table->string('name')->index();
|
||||
$table->text('trans_name')->nullable();
|
||||
|
||||
$table->decimal('free', 8, 2)->nullable();
|
||||
|
||||
$table->boolean('active')->default(false);
|
||||
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('shippings');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateShippingPricesTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('shipping_prices', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->unsignedInteger('shipping_id');
|
||||
|
||||
$table->decimal('price', 8, 2)->nullable();
|
||||
$table->decimal('tax', 5, 2)->nullable();
|
||||
$table->decimal('factor', 5, 2)->nullable();
|
||||
|
||||
$table->decimal('total_from', 8, 2)->nullable();
|
||||
$table->decimal('total_to', 8, 2)->nullable();
|
||||
|
||||
$table->unsignedInteger('weight_from')->nullable();
|
||||
$table->unsignedInteger('weight_to')->nullable();
|
||||
|
||||
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('shipping_id')
|
||||
->references('id')
|
||||
->on('shippings')
|
||||
->onDelete('cascade');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('shipping_prices');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateShippingCountriesTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('shipping_countries', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->unsignedInteger('shipping_id');
|
||||
$table->unsignedInteger('country_id')->nullable()->index();
|
||||
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('shipping_id')
|
||||
->references('id')
|
||||
->on('shippings')
|
||||
->onDelete('cascade');
|
||||
|
||||
$table->foreign('country_id')
|
||||
->references('id')
|
||||
->on('countries');
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('shipping_countries');
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue