Subversion-Projekte lars-tiefland.webanos.marine-sales.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
    {
        /**
         * The database connection that should be used by the migration.
         *
         * @var string
         */
        protected $connection = 'order';

        /**
         * Run the migrations.
         *
         * @return void
         */
        public function up(): void
        {
            if ( !Schema::hasTable( 'order_addresses' ) )
            {
                Schema::create( 'order_addresses', function ( Blueprint $table )
                {
                    $table->id();
                    $table->foreignId( 'user_id' )->nullable()->constrained()->cascadeOnUpdate()->nullOnDelete();
                    $table->string( "salutation" )->default( "" );
                    $table->string( "pro_title" )->default( "" );
                    $table->string( "name" )->default( "" );
                    $table->string( "lastname" )->default( "" );
                    $table->string( "company" )->default( '' );
                    $table->string( "company2" )->default( '' );
                    $table->string( "street" )->default( "" );
                    $table->string( "houseno" )->default( "" );
                    $table->string( "street2" )->default( "" );
                    $table->string( "zip" )->default( "" );
                    $table->string( "city" )->default( "" );
                    $table->unsignedSmallInteger( "country_id" )->nullable()->references( 'id' )->on( 'content_management.countries' )->cascadeOnUpdate()->nullOnDelete();
                    $table->unsignedSmallInteger( "state_id" )->nullable()->references( 'id' )->on( 'content_management.states' )->cascadeOnUpdate()->nullOnDelete();
                    $table->string( "phone" )->default( "" );
                    $table->string( "fax" )->default( "" );
                    $table->string( "email" )->default( "" );
                    $table->string( "legal_form" )->default( "" );
                    $table->string( "hr_nr" )->default( "" );
                    $table->string( "vat_id" )->default( "" );
                    $table->string( "vat_free", 3 )->default( "" );
                    $table->string( "nettocalculation", 3 )->default( "" );
                    $table->text( "comment" )->default( "" );
                    $table->string( 'created_by' )->default( '' );
                    $table->string( 'updated_by' )->default( '' );
                    $table->timestamps();
                } );
            }
        }

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