Subversion-Projekte lars-tiefland.webanos.faltradxxs.de

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
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
            Schema::create( 'prices', function ( Blueprint $table )
17
            {
18
                $table->id();
19
                $table->foreignId( 'item_id' )->constrained()->cascadeOnUpdate()->cascadeOnDelete();
20
                $table->unsignedInteger( 'preis_index' )->index();
21
                $table->float( 'preis' )->index();
22
                $table->text( 'staffel' );
23
                $table->unique( [ "item_id", "preis_index" ] );
24
                $table->string( 'created_by' )->default( '' );
25
                $table->string( 'updated_by' )->default( '' );
26
                $table->timestamps();
27
            } );
28
        }
29
 
30
        /**
31
         * Reverse the migrations.
32
         *
33
         * @return void
34
         */
35
        public function down(): void
36
        {
37
            Schema::dropIfExists( 'prices' );
38
        }
39
    };