| 4 |
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 |
* The database connection that should be used by the migration.
|
|
|
11 |
*
|
|
|
12 |
* @var string
|
|
|
13 |
*/
|
|
|
14 |
protected $connection = 'order';
|
|
|
15 |
|
|
|
16 |
/**
|
|
|
17 |
* Run the migrations.
|
|
|
18 |
*
|
|
|
19 |
* @return void
|
|
|
20 |
*/
|
|
|
21 |
public function up(): void
|
|
|
22 |
{
|
|
|
23 |
if ( !Schema::hasTable( 'addresses' ) )
|
|
|
24 |
{
|
|
|
25 |
Schema::create( 'addresses', function ( Blueprint $table )
|
|
|
26 |
{
|
|
|
27 |
$table->id();
|
|
|
28 |
$table->foreignId( 'user_id' )->nullable()->constrained()->cascadeOnUpdate()->nullOnDelete();
|
|
|
29 |
$table->string( "salutation" )->default( "" );
|
|
|
30 |
$table->string( "pro_title" )->default( "" );
|
|
|
31 |
$table->string( "name" )->default( "" );
|
|
|
32 |
$table->string( "lastname" )->default( "" );
|
|
|
33 |
$table->string( "company" )->default( '' );
|
|
|
34 |
$table->string( "company2" )->default( '' );
|
|
|
35 |
$table->string( "street" )->default( "" );
|
|
|
36 |
$table->string( "houseno" )->default( "" );
|
|
|
37 |
$table->string( "street2" )->default( "" );
|
|
|
38 |
$table->string( "zip" )->default( "" );
|
|
|
39 |
$table->string( "city" )->default( "" );
|
|
|
40 |
$table->unsignedSmallInteger( "country_id" )->nullable()->references( 'id' )->on( 'content_management.countries' )->cascadeOnUpdate()->nullOnDelete();
|
|
|
41 |
$table->unsignedSmallInteger( "state_id" )->nullable()->references( 'id' )->on( 'content_management.states' )->cascadeOnUpdate()->nullOnDelete();
|
|
|
42 |
$table->string( "phone" )->default( "" );
|
|
|
43 |
$table->string( "fax" )->default( "" );
|
|
|
44 |
$table->string( "email" )->default( "" );
|
|
|
45 |
$table->string( "legal_form" )->default( "" );
|
|
|
46 |
$table->string( "hr_nr" )->default( "" );
|
|
|
47 |
$table->string( "vat_id" )->default( "" );
|
|
|
48 |
$table->string( "vat_free", 3 )->default( "" );
|
|
|
49 |
$table->string( "nettocalculation", 3 )->default( "" );
|
|
|
50 |
$table->text( "comment" )->default( "" );
|
|
|
51 |
$table->string( 'created_by' )->default( '' );
|
|
|
52 |
$table->string( 'updated_by' )->default( '' );
|
|
|
53 |
$table->timestamps();
|
|
|
54 |
} );
|
|
|
55 |
}
|
|
|
56 |
}
|
|
|
57 |
|
|
|
58 |
/**
|
|
|
59 |
* Reverse the migrations.
|
|
|
60 |
*
|
|
|
61 |
* @return void
|
|
|
62 |
*/
|
|
|
63 |
public function down(): void
|
|
|
64 |
{
|
|
|
65 |
Schema::dropIfExists( 'addresses' );
|
|
|
66 |
}
|
|
|
67 |
};
|