eOSP2/database/migrations/2019_11_07_230105_create_vehicles_table.php
Krzysztof Strzelecki d7603c07fd Merge branch 'master' of https://git.wmi.amu.edu.pl/s421507/eOSP2
# Conflicts:
#	.idea/workspace.xml

Signed-off-by: Krzysztof Strzelecki <ks37365@st.amu.edu.pl>
2020-08-17 11:44:34 +02:00

57 lines
2.2 KiB
PHP

<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateVehiclesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('vehicles', function (Blueprint $table) {
$table->increments('id');
$table->integer('fire_station_id')->unsigned();
$table->foreign('fire_station_id')->references('id')->on('fire_stations')->onDelete('cascade');
$table->string('name');
$table->string('codename');
$table->string('brand')->nullable();
$table->string('registration_number', 20)->nullable();
$table->integer('production_year')->nullable();
$table->date('exam_expiration_date')->nullable(); //Data ważności przegladu
$table->date('insurance_expiration_date')->nullable();
$table->string('drive_type')->nullable(); //układ napędowy
$table->string('chassis_type')->nullable(); //typ podwozia
$table->string('body_producer')->nullable(); //producent nadwozia
$table->integer('crew_number')->nullable();
$table->integer('foam_agent')->nullable(); //Ilość środka pianotwórczego w litrach
$table->integer('engine_power')->nullable(); //Moc silnika w kW
$table->integer('mass')->nullable(); //Masa całkowita pojazdu
$table->string('chassis_number')->nullable();
$table->string('engine_number')->nullable();
$table->string('fuel_type')->nullable();
$table->integer('chassis_poduction_year')->nullable();
$table->date('entry_into_service_date')->nullable();
$table->string('fire_engine_pump_description')->nullable();// Opis autopompy
$table->integer('status')->default('0');
$table->integer('editor_id')->nullable()->default(null);
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('vehicles');
}
}