Subversion-Projekte lars-tiefland.laravel_shop

Revision

Revision 476 | Zur aktuellen Revision | Details | Vergleich mit vorheriger | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
398 lars 1
<?php
2
 
476 lars 3
    use Illuminate\Database\Migrations\Migration;
4
    use Illuminate\Database\Schema\Blueprint;
5
    use Illuminate\Support\Facades\Schema;
398 lars 6
 
476 lars 7
    return new class extends Migration
398 lars 8
    {
476 lars 9
        /**
10
         * Run the migrations.
11
         *
12
         * @return void
13
         */
14
        public function up()
15
        {
16
            if ( !Schema::hasTable( 'shippings' ) )
17
            {
18
                Schema::create( 'shippings', function ( Blueprint $table )
19
                {
20
                    $table->id();
513 lars 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( '' );
476 lars 39
                    $table->timestamps();
40
                } );
41
            }
42
        }
398 lars 43
 
476 lars 44
        /**
45
         * Reverse the migrations.
46
         *
47
         * @return void
48
         */
49
        public function down()
50
        {
51
            Schema::dropIfExists( 'shippings' );
52
        }
53
    };