File: /var/www/ipsremont-demo/database/migrations/2021_02_24_150543_create_repair_prices_table.php
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateRepairPricesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::dropIfExists('repair_prices');
Schema::create('repair_prices', function (Blueprint $table) {
$table->id();
$table->string('device_external_id', 50);
$table->unsignedBigInteger('service_id');
$table->double('diagnostics', 9,2);
$table->double('repair_category_1', 9,2);
$table->double('repair_category_2', 9,2);
$table->double('repair_category_3', 9,2);
$table->timestamp('created_at')->nullable()->useCurrent();
$table->timestamp('updated_at')->nullable()->useCurrent();
$table->unique(['device_external_id', 'service_id'], 'device_external_id');
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('repair_prices');
}
}