| @@ 7-37 (lines=31) @@ | ||
| 4 | use Illuminate\Database\Schema\Blueprint; |
|
| 5 | use Illuminate\Database\Migrations\Migration; |
|
| 6 | ||
| 7 | class CreateCustomerContactPhonesTable extends Migration |
|
| 8 | { |
|
| 9 | /** |
|
| 10 | * Run the migrations. |
|
| 11 | * |
|
| 12 | * @return void |
|
| 13 | */ |
|
| 14 | public function up() |
|
| 15 | { |
|
| 16 | Schema::create('customer_contact_phones', function(Blueprint $table) { |
|
| 17 | $table->increments('id'); |
|
| 18 | $table->integer('cont_id')->unsigned(); |
|
| 19 | $table->integer('phone_type_id')->unsigned(); |
|
| 20 | $table->text('phone_number'); |
|
| 21 | $table->text('extension')->nullable(); |
|
| 22 | $table->timestamps(); |
|
| 23 | $table->foreign('cont_id')->references('cont_id')->on('customer_contacts')->onUpdate('cascade')->onDelete('cascade'); |
|
| 24 | $table->foreign('phone_type_id')->references('phone_type_id')->on('phone_number_types')->onUpdate('cascade'); |
|
| 25 | }); |
|
| 26 | } |
|
| 27 | ||
| 28 | /** |
|
| 29 | * Reverse the migrations. |
|
| 30 | * |
|
| 31 | * @return void |
|
| 32 | */ |
|
| 33 | public function down() |
|
| 34 | { |
|
| 35 | Schema::dropIfExists('customer_contact_phones'); |
|
| 36 | } |
|
| 37 | } |
|
| 38 | ||
| @@ 7-38 (lines=32) @@ | ||
| 4 | use Illuminate\Database\Schema\Blueprint; |
|
| 5 | use Illuminate\Database\Migrations\Migration; |
|
| 6 | ||
| 7 | class CreateCustomerNotesTable extends Migration |
|
| 8 | { |
|
| 9 | /** |
|
| 10 | * Run the migrations. |
|
| 11 | * |
|
| 12 | * @return void |
|
| 13 | */ |
|
| 14 | public function up() |
|
| 15 | { |
|
| 16 | Schema::create('customer_notes', function(Blueprint $table) { |
|
| 17 | $table->increments('note_id'); |
|
| 18 | $table->integer('cust_id')->unsigned(); |
|
| 19 | $table->integer('user_id')->unsigned(); |
|
| 20 | $table->boolean('urgent')->default(0)->nullable(); |
|
| 21 | $table->text('subject'); |
|
| 22 | $table->longText('description'); |
|
| 23 | $table->timestamps(); |
|
| 24 | $table->foreign('cust_id')->references('cust_id')->on('customers')->onUpdate('cascade')->onDelete('cascade'); |
|
| 25 | $table->foreign('user_id')->references('user_id')->on('users')->onUpdate('cascade'); |
|
| 26 | }); |
|
| 27 | } |
|
| 28 | ||
| 29 | /** |
|
| 30 | * Reverse the migrations. |
|
| 31 | * |
|
| 32 | * @return void |
|
| 33 | */ |
|
| 34 | public function down() |
|
| 35 | { |
|
| 36 | Schema::dropIfExists('customer_notes'); |
|
| 37 | } |
|
| 38 | } |
|
| 39 | ||
| @@ 7-39 (lines=33) @@ | ||
| 4 | use Illuminate\Database\Schema\Blueprint; |
|
| 5 | use Illuminate\Database\Migrations\Migration; |
|
| 6 | ||
| 7 | class CreateFileLinksTable extends Migration |
|
| 8 | { |
|
| 9 | /** |
|
| 10 | * Run the migrations. |
|
| 11 | * |
|
| 12 | * @return void |
|
| 13 | */ |
|
| 14 | public function up() |
|
| 15 | { |
|
| 16 | Schema::create('file_links', function(Blueprint $table) { |
|
| 17 | $table->increments('link_id'); |
|
| 18 | $table->integer('user_id')->unsigned(); |
|
| 19 | $table->integer('cust_id')->unsigned()->nullable(); |
|
| 20 | $table->text('link_hash'); |
|
| 21 | $table->text('link_name'); |
|
| 22 | $table->date('expire'); |
|
| 23 | $table->boolean('allow_upload'); |
|
| 24 | $table->timestamps(); |
|
| 25 | $table->foreign('user_id')->references('user_id')->on('users')->onUpdate('cascade')->onDelete('cascade'); |
|
| 26 | $table->foreign('cust_id')->references('cust_id')->on('customers')->onUpdate('cascade')->onDelete('cascade'); |
|
| 27 | }); |
|
| 28 | } |
|
| 29 | ||
| 30 | /** |
|
| 31 | * Reverse the migrations. |
|
| 32 | * |
|
| 33 | * @return void |
|
| 34 | */ |
|
| 35 | public function down() |
|
| 36 | { |
|
| 37 | Schema::dropIfExists('file_links'); |
|
| 38 | } |
|
| 39 | } |
|
| 40 | ||