Subversion-Projekte lars-tiefland.laravel_shop

Revision

Revision 613 | Details | Vergleich mit vorheriger | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
2 lars 1
<?php
2
 
297 lars 3
    use Illuminate\Database\Migrations\Migration;
4
    use Illuminate\Database\Schema\Blueprint;
5
    use Illuminate\Support\Facades\Schema;
2 lars 6
 
297 lars 7
    return new class extends Migration
2 lars 8
    {
297 lars 9
        /**
10
         * Run the migrations.
11
         *
12
         * @return void
13
         */
14
        public function up(): void
15
        {
475 lars 16
            if ( !Schema::hasTable( 'directories' ) )
297 lars 17
            {
475 lars 18
                Schema::create( 'directories', function ( Blueprint $table )
19
                {
20
                    $table->bigInteger( "id" )->autoIncrement();
613 lars 21
                    $table->foreignId( "directory_id" )->unsigned( false )->nullable()->constrained()->cascadeOnUpdate()->nullOnDelete();
1600 lars 22
                    $table->foreignId( "manufacturer_id" )->nullable()->constrained()->cascadeOnUpdate()->nullOnDelete();
475 lars 23
                    $table->string( "name" )->default( "" );
24
                    $table->string( "slug" )->default( "" );
25
                    $table->string( "kennung" )->default( '' );
26
                    $table->unsignedTinyInteger( 'articlemaster' )->default( '0' );
27
                    $table->unsignedTinyInteger( 'status' )->default( '0' );
28
                    $table->string( 'url' )->default( '' );
29
                    $table->text( 'description' )->default( '' );
1600 lars 30
                    $table->text( 'description2' )->default( '' );
475 lars 31
                    $table->string( 'short_line_1' )->default( '' );
32
                    $table->string( 'created_by' )->default( '' );
33
                    $table->string( 'updated_by' )->default( '' );
34
                    $table->timestamps();
35
                } );
36
            }
297 lars 37
        }
2 lars 38
 
297 lars 39
        /**
40
         * Reverse the migrations.
41
         *
42
         * @return void
43
         */
44
        public function down(): void
45
        {
46
            Schema::dropIfExists( 'directories' );
47
        }
48
    };