Total Complexity | 2 |
Total Lines | 33 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
7 | class CreateCustomersTable extends Migration |
||
8 | { |
||
9 | /** |
||
10 | * Run the migrations. |
||
11 | * |
||
12 | * @return void |
||
13 | */ |
||
14 | public function up() |
||
15 | { |
||
16 | Schema::create('customers', function(Blueprint $table) { |
||
17 | $table->increments('cust_id'); |
||
18 | $table->integer('parent_id')->nullable()->unsigned(); |
||
19 | $table->text('name'); |
||
20 | $table->text('dba_name')->nullable(); |
||
21 | $table->text('address'); |
||
22 | $table->text('city'); |
||
23 | $table->text('state'); |
||
24 | $table->integer('zip'); |
||
25 | $table->boolean('active')->default(1); |
||
26 | $table->softDeletes(); |
||
27 | $table->timestamps(); |
||
28 | $table->foreign('parent_id')->references('cust_id')->on('customers')->onUpdate('cascade'); |
||
29 | }); |
||
30 | } |
||
31 | |||
32 | /** |
||
33 | * Reverse the migrations. |
||
34 | * |
||
35 | * @return void |
||
36 | */ |
||
37 | public function down() |
||
38 | { |
||
39 | Schema::dropIfExists('customers'); |
||
40 | } |
||
42 |