Subversion-Projekte lars-tiefland.laravel_shop

Revision

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

Revision Autor Zeilennr. Zeile
594 lars 1
<?php
2
 
595 lars 3
    use Illuminate\Database\Migrations\Migration;
4
    use Illuminate\Database\Schema\Blueprint;
5
    use Illuminate\Support\Facades\Schema;
594 lars 6
 
595 lars 7
    return new class extends Migration
594 lars 8
    {
595 lars 9
        /**
10
         * Run the migrations.
11
         *
12
         * @return void
13
         */
14
        public function up(): void
15
        {
16
            Schema::create( 'templates', function ( Blueprint $table )
17
            {
18
                $table->id();
19
                $table->foreignId( 'shop_id' )->nullable()->constrained()->cascadeOnUpdate()->nullOnDelete();
20
                $table->string( 'name' )->default( '' );
21
                $table->text( "description" )->default( '' );
22
                $table->string( 'template_key' )->default( '' );
23
                $table->text( 'template_value' )->default( '' );
24
                $table->enum( 'type', [ '', 'action', 'item', 'directory', 'articlemaster' ] )->default( '' );
25
                $table->string( 'created_by' )->default( '' );
26
                $table->string( 'updated_by' )->default( '' );
27
                $table->timestamps();
28
            } );
29
        }
594 lars 30
 
595 lars 31
        /**
32
         * Reverse the migrations.
33
         *
34
         * @return void
35
         */
36
        public function down(): void
37
        {
38
            Schema::dropIfExists( 'templates' );
39
        }
40
    };