| 2 |
lars |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
use Illuminate\Database\Migrations\Migration;
|
|
|
4 |
use Illuminate\Database\Schema\Blueprint;
|
|
|
5 |
use Illuminate\Support\Facades\Schema;
|
|
|
6 |
|
|
|
7 |
return new class extends Migration
|
|
|
8 |
{
|
|
|
9 |
/**
|
|
|
10 |
* Run the migrations.
|
|
|
11 |
*
|
|
|
12 |
* @return void
|
|
|
13 |
*/
|
|
|
14 |
public function up(): void
|
|
|
15 |
{
|
|
|
16 |
if ( !Schema::hasTable( 'shippings' ) )
|
|
|
17 |
{
|
|
|
18 |
Schema::create( 'shippings', function ( Blueprint $table )
|
|
|
19 |
{
|
|
|
20 |
$table->id();
|
|
|
21 |
$table->unsignedInteger( 'rank' )->default( '0' );
|
|
|
22 |
$table->foreignId( 'shipping_group_id' )->nullable()->constrained()->cascadeOnUpdate()->nullOnDelete();
|
|
|
23 |
$table->string( 'name' )->default( '' );
|
|
|
24 |
$table->text( 'info_shop' )->default( '' );
|
|
|
25 |
$table->text( 'info_mail' )->default( '' );
|
|
|
26 |
$table->text( 'info_internal' )->default( '' );
|
|
|
27 |
$table->unsignedTinyInteger( 'island_shipping' )->default( '0' );
|
|
|
28 |
$table->text( 'additions' )->default( '' );
|
|
|
29 |
$table->unsignedInteger( 'status' )->default( '0' );
|
|
|
30 |
$table->float( 'price' )->default( '0' );
|
|
|
31 |
$table->float( 'calc_weight_from' )->default( '0' );
|
|
|
32 |
$table->float( 'calc_weight_to' )->default( '0' );
|
|
|
33 |
$table->float( 'calc_price_from' )->default( '0' );
|
|
|
34 |
$table->float( 'calc_price_to' )->default( '0' );
|
|
|
35 |
$table->unsignedTinyInteger( 'tax_rate' )->default( '98' );
|
|
|
36 |
$table->string( 'conditions' )->default( '' );
|
|
|
37 |
$table->string( 'created_by' )->default( '' );
|
|
|
38 |
$table->string( 'updated_by' )->default( '' );
|
|
|
39 |
$table->timestamps();
|
|
|
40 |
} );
|
|
|
41 |
}
|
|
|
42 |
}
|
|
|
43 |
|
|
|
44 |
/**
|
|
|
45 |
* Reverse the migrations.
|
|
|
46 |
*
|
|
|
47 |
* @return void
|
|
|
48 |
*/
|
|
|
49 |
public function down(): void
|
|
|
50 |
{
|
|
|
51 |
Schema::dropIfExists( 'shippings' );
|
|
|
52 |
}
|
|
|
53 |
};
|