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

Revision

Blame | Letzte Änderung | Log anzeigen | RSS feed

<?php

    use Illuminate\Database\Migrations\Migration;
    use Illuminate\Database\Schema\Blueprint;
    use Illuminate\Support\Facades\Schema;

    return new class extends Migration
    {
        /**
         * Run the migrations.
         *
         * @return void
         */
        public function up(): void
        {
            Schema::create( 'prices', function ( Blueprint $table )
            {
                $table->id();
                $table->foreignId( 'item_id' )->constrained()->cascadeOnUpdate()->cascadeOnDelete();
                $table->unsignedInteger( 'preis_index' )->index();
                $table->float( 'preis' )->index();
                $table->text( 'staffel' );
                $table->unique( [ "item_id", "preis_index" ] );
                $table->string( 'created_by' )->default( '' );
                $table->string( 'updated_by' )->default( '' );
                $table->timestamps();
            } );
        }

        /**
         * Reverse the migrations.
         *
         * @return void
         */
        public function down(): void
        {
            Schema::dropIfExists( 'prices' );
        }
    };