# Conflicts:
#	.idea/workspace.xml

Signed-off-by: Krzysztof Strzelecki <ks37365@st.amu.edu.pl>
This commit is contained in:
Krzysztof Strzelecki 2020-08-17 11:43:37 +02:00
parent c277f77f8f
commit d7603c07fd
24 changed files with 206 additions and 435 deletions

View File

@ -15,25 +15,43 @@ class CreateUsersTable extends Migration
{ {
Schema::create('users', function (Blueprint $table) { Schema::create('users', function (Blueprint $table) {
$table->increments('id'); $table->increments('id');
$table->string('password', 100); $table->string('password');
$table->string('name', 45); $table->string('name');
$table->string('surname', 45); $table->string('surname');
$table->string('PESEL',11); $table->string('PESEL',11);
$table->string('phoneNumber', 9); $table->string('phoneNumber', 20);
$table->string('email', 50)->unique(); $table->string('email', 100)->unique();
$table->integer('fireStationID')->nullable(); $table->integer('fire_station_id')->unsigned()->nullable();
$table->integer('functionID'); $table->foreign('fire_station_id')->references('id')->on('fire_stations')->onDelete('cascade');
$table->integer('degreeID'); $table->integer('unit_function_id')->unsigned()->nullable();
$table->string('number', 45)->nullable()->default(null); $table->foreign('unit_function_id')->references('id')->on('unit_functions')->onDelete('set null');
$table->integer('statusID')->default(0); $table->integer('rank_id')->unsigned()->nullable();
$table->integer('deleted')->default(0); $table->foreign('rank_id')->references('id')->on('ranks')->onDelete('set null');
$table->integer('creatorID')->nullable()->default(null); $table->string('number')->nullable()->default(null);
$table->integer('changingID')->nullable()->default(null); $table->string('second_name')->nullable()->default(null);
$table->string('fathers_name')->nullable()->default(null);
$table->string('mothers_name')->nullable()->default(null);
$table->string('address')->nullable()->default(null);
$table->string('apartment')->nullable()->default(null); //nr domu
$table->string('place_of_birth')->nullable()->default(null);
$table->string('drivers_license')->nullable()->default(null);
$table->date('joining_osp_date')->nullable()->default(null);
$table->string('id_series', 3)->nullable()->default(null);
$table->string('id_number', 6)->nullable()->default(null); //nr dowodu osobistego
$table->date('id_valid_until')->nullable()->default(null);
$table->string('identity_card_number')->nullable()->default(null); //nr legitymacji strażackiej
$table->string('home_phone_number', 20)->nullable()->default(null);
$table->string('education')->nullable()->default(null);
$table->string('profession')->nullable()->default(null);
$table->integer('status_id')->default(0); //aktywny/zawieszony
$table->integer('creator_id')->nullable()->default(null);
$table->integer('editor_id')->nullable()->default(null);
$table->boolean('confirmed')->default(0); $table->boolean('confirmed')->default(0);
$table->string('confirmation_code')->nullable(); $table->string('confirmation_code')->nullable();
$table->timestamp('email_verified_at')->nullable(); $table->timestamp('email_verified_at')->nullable();
$table->rememberToken(); $table->rememberToken();
$table->timestamps(); $table->timestamps();
$table->softDeletes();
}); });
} }

View File

@ -13,25 +13,28 @@ class CreateFireStationsTable extends Migration
*/ */
public function up() public function up()
{ {
Schema::create('fireStations', function (Blueprint $table) { Schema::create('fire_stations', function (Blueprint $table) {
$table->increments('id'); $table->increments('id');
$table->string('name', 45); $table->string('name');
$table->integer('number'); $table->integer('number');
$table->string('voivodeship', 45); $table->integer('province_id')->unsigned();
$table->string('county', 45); $table->foreign('province_id')->references('id')->on('provinces');
$table->string('community', 45); $table->integer('district_id')->unsigned();
$table->string('postOffice', 45); $table->foreign('district_id')->references('id')->on('districts');
$table->string('zipCode', 6); $table->integer('commune_id')->unsigned();
$table->string('address', 45); $table->foreign('commune_id')->references('id')->on('communes');
$table->string('post_office');
$table->string('zip_code');
$table->string('address');
$table->float('latitude', 9,5); $table->float('latitude', 9,5);
$table->float('longitude', 9,5); $table->float('longitude', 9,5);
$table->string('KRS', 10); $table->string('KRS', 10);
$table->string('NIP', 10); $table->string('NIP', 10);
$table->string('phoneNumber', 11); $table->string('phone_number', 20);
$table->string('email', 100); $table->string('email');
$table->integer('deleted')->default(0); $table->integer('deleted')->default(0);
$table->integer('creatorID')->nullable()->default(null); $table->integer('creator_id')->nullable()->default(null);
$table->integer('changingID')->nullable()->default(null); $table->integer('editor_id')->nullable()->default(null);
$table->rememberToken(); $table->rememberToken();
$table->timestamps(); $table->timestamps();
}); });
@ -44,6 +47,6 @@ class CreateFireStationsTable extends Migration
*/ */
public function down() public function down()
{ {
Schema::dropIfExists('fireStations'); Schema::dropIfExists('fire_stations');
} }
} }

View File

@ -1,49 +0,0 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class JednostkiTerytorialne extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('wojewodztwa', function (Blueprint $table) {
// $table->increments('id');
$table->integer('id');
$table->string('name');
});
Schema::create('powiaty', function (Blueprint $table) {
$table->integer('id');
$table->integer('wojewodztwo_id');
$table->string('name');
});
Schema::create('gminy', function (Blueprint $table) {
$table->integer('id');
$table->integer('wojewodztwo_id');
$table->integer('powiat_id');
$table->string('name');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('wojewodztwa');
Schema::dropIfExists('powiaty');
Schema::dropIfExists('gminy');
}
}

View File

@ -14,18 +14,9 @@ class CreateRanksTable extends Migration
public function up() public function up()
{ {
Schema::create('ranks', function (Blueprint $table) { Schema::create('ranks', function (Blueprint $table) {
$table->integer('id'); $table->increments('id');
$table->string('rank', 60); $table->string('rank');
}); });
DB::table('ranks')->insert([ 'id' => '1', 'rank' => 'strażak' ]);
DB::table('ranks')->insert([ 'id' => '2', 'rank' => 'starszy strażak' ]);
DB::table('ranks')->insert([ 'id' => '3', 'rank' => 'dowódca roty' ]);
DB::table('ranks')->insert([ 'id' => '4', 'rank' => 'pomocnik dowódcy sekcji' ]);
DB::table('ranks')->insert([ 'id' => '5', 'rank' => 'dowódca sekcji' ]);
DB::table('ranks')->insert([ 'id' => '6', 'rank' => 'pomocnik dowódcy plutonu' ]);
DB::table('ranks')->insert([ 'id' => '7', 'rank' => 'dowódca plutonu' ]);
} }
/** /**

View File

@ -13,18 +13,10 @@ class CreateUnitFunctionsTable extends Migration
*/ */
public function up() public function up()
{ {
Schema::create('unitFunctions', function (Blueprint $table) { Schema::create('unit_functions', function (Blueprint $table) {
$table->integer('id'); $table->increments('id');
$table->string('unitFunction', 60); $table->string('unit_function');
}); });
DB::table('unitFunctions')->insert([ 'id' => '1', 'unitFunction' => 'naczelnik' ]);
DB::table('unitFunctions')->insert([ 'id' => '2', 'unitFunction' => 'zastępca naczelnika' ]);
DB::table('unitFunctions')->insert([ 'id' => '3', 'unitFunction' => 'skarbnik' ]);
DB::table('unitFunctions')->insert([ 'id' => '4', 'unitFunction' => 'sekretarz' ]);
DB::table('unitFunctions')->insert([ 'id' => '5', 'unitFunction' => 'prezes' ]);
DB::table('unitFunctions')->insert([ 'id' => '6', 'unitFunction' => 'przewodniczący komisji rewizyjnej' ]);
DB::table('unitFunctions')->insert([ 'id' => '7', 'unitFunction' => 'członek komisji rewizyjnej' ]);
} }
/** /**
@ -34,6 +26,6 @@ class CreateUnitFunctionsTable extends Migration
*/ */
public function down() public function down()
{ {
Schema::dropIfExists('unitFunctions'); Schema::dropIfExists('unit_functions');
} }
} }

View File

@ -15,29 +15,32 @@ class CreateVehiclesTable extends Migration
{ {
Schema::create('vehicles', function (Blueprint $table) { Schema::create('vehicles', function (Blueprint $table) {
$table->increments('id'); $table->increments('id');
$table->integer('fireStationID'); $table->integer('fire_station_id')->unsigned();
$table->string('name', 45); $table->foreign('fire_station_id')->references('id')->on('fire_stations')->onDelete('cascade');
$table->string('codename', 45); $table->string('name');
$table->string('brand',45)->nullable(); $table->string('codename');
$table->string('registrationNumber', 15)->nullable(); $table->string('brand')->nullable();
$table->integer('productionYear')->nullable(); $table->string('registration_number', 20)->nullable();
$table->date('examExpirationDate')->nullable(); //Data ważności przegladu $table->integer('production_year')->nullable();
$table->date('insuranceExpirationDate')->nullable(); $table->date('exam_expiration_date')->nullable(); //Data ważności przegladu
$table->string('driveType',45)->nullable(); //układ napędowy $table->date('insurance_expiration_date')->nullable();
$table->string('chassisType',45)->nullable(); //typ podwozia $table->string('drive_type')->nullable(); //układ napędowy
$table->string('bodyProducer',45)->nullable(); //producent nadwozia $table->string('chassis_type')->nullable(); //typ podwozia
$table->integer('crewNumber')->nullable(); $table->string('body_producer')->nullable(); //producent nadwozia
$table->integer('foamAgent')->nullable(); //Ilość środka pianotwórczego w litrach $table->integer('crew_number')->nullable();
$table->integer('enginePower')->nullable(); //Moc silnika w kW $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->integer('mass')->nullable(); //Masa całkowita pojazdu
$table->string('chassisNumber')->nullable(); $table->string('chassis_number')->nullable();
$table->string('engineNumber')->nullable(); $table->string('engine_number')->nullable();
$table->string('fuelType',45)->nullable(); $table->string('fuel_type')->nullable();
$table->integer('chassisPoductionYear')->nullable(); $table->integer('chassis_poduction_year')->nullable();
$table->date('entryIntoServiceDate')->nullable(); $table->date('entry_into_service_date')->nullable();
$table->string('fireEnginePumpDescription')->nullable();// Opis autopompy $table->string('fire_engine_pump_description')->nullable();// Opis autopompy
$table->softDeletes(); $table->integer('status')->default('0');
$table->integer('editor_id')->nullable()->default(null);
$table->timestamps(); $table->timestamps();
$table->softDeletes();
}); });
} }

View File

@ -15,14 +15,18 @@ class CreateOperationsTable extends Migration
{ {
Schema::create('operations', function (Blueprint $table) { Schema::create('operations', function (Blueprint $table) {
$table->increments('id'); $table->increments('id');
$table->dateTime('operationDate'); $table->integer('fire_station_id')->unsigned();
$table->string('location', 100); $table->foreign('fire_station_id')->references('id')->on('fire_stations')->onDelete('cascade');
$table->string('target', 100); $table->dateTime('operation_date');
$table->string('dangerType', 100); $table->string('location');
$table->string('target');
$table->string('danger_type');
$table->longtext('description'); $table->longtext('description');
$table->integer('commanderID'); $table->integer('commander_id')->unsigned();
$table->softDeletes(); $table->foreign('commander_id')->references('id')->on('users');
$table->integer('editor_id')->nullable()->default(null);
$table->timestamps(); $table->timestamps();
$table->softDeletes();
}); });
} }

View File

@ -13,11 +13,14 @@ class CreateOperationsTrucksTable extends Migration
*/ */
public function up() public function up()
{ {
Schema::create('operationsTrucks', function (Blueprint $table) { Schema::create('operations_vehicles', function (Blueprint $table) {
$table->increments('id'); $table->increments('id');
$table->integer('operationID'); $table->integer('operation_id')->unsigned();
$table->integer('truckID'); $table->foreign('operation_id')->references('id')->on('operations')->onDelete('cascade');
$table->integer('driverID'); $table->integer('vehicle_id')->unsigned();
$table->foreign('vehicle_id')->references('id')->on('vehicles');
$table->integer('driver_id')->unsigned();
$table->foreign('driver_id')->references('id')->on('users');
$table->timestamps(); $table->timestamps();
}); });
} }
@ -29,6 +32,6 @@ class CreateOperationsTrucksTable extends Migration
*/ */
public function down() public function down()
{ {
Schema::dropIfExists('operationsTrucks'); Schema::dropIfExists('operations_vehicles');
} }
} }

View File

@ -13,11 +13,13 @@ class CreateOperationsMembersTable extends Migration
*/ */
public function up() public function up()
{ {
Schema::create('operationsMembers', function (Blueprint $table) { Schema::create('operations_members', function (Blueprint $table) {
$table->increments('id'); $table->increments('id');
$table->integer('operationID'); $table->integer('operation_id')->unsigned();
$table->integer('memberID'); $table->foreign('operation_id')->references('id')->on('operations')->onDelete('cascade');
$table->boolean('privateTransport'); $table->integer('member_id')->unsigned();
$table->foreign('member_id')->references('id')->on('users');
$table->boolean('private_transport');
$table->timestamps(); $table->timestamps();
}); });
} }
@ -29,6 +31,6 @@ class CreateOperationsMembersTable extends Migration
*/ */
public function down() public function down()
{ {
Schema::dropIfExists('operationsMembers'); Schema::dropIfExists('operations_members');
} }
} }

View File

@ -1,33 +0,0 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddFireStationIDColumnToOperationsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('operations', function (Blueprint $table) {
//
$table->integer('fireStationID');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('operations', function (Blueprint $table) {
//
});
}
}

View File

@ -15,12 +15,14 @@ class CreateEquipmentTable extends Migration
{ {
Schema::create('equipment', function (Blueprint $table) { Schema::create('equipment', function (Blueprint $table) {
$table->increments('id'); $table->increments('id');
$table->integer('fireStationID'); $table->integer('fire_station_id')->unsigned();
$table->string('name', 45); $table->foreign('fire_station_id')->references('id')->on('fire_stations')->onDelete('cascade');
$table->string('name');
$table->integer('amount'); $table->integer('amount');
$table->string('parameter', 45)->nullable(); $table->string('parameter')->nullable();
$table->softDeletes(); $table->integer('editor_id')->nullable()->default(null);
$table->timestamps(); $table->timestamps();
$table->softDeletes();
}); });
} }

View File

@ -15,9 +15,11 @@ class CreateTrainingsTable extends Migration
{ {
Schema::create('trainings', function (Blueprint $table) { Schema::create('trainings', function (Blueprint $table) {
$table->increments('id'); $table->increments('id');
$table->integer('fireStationID'); $table->integer('fire_station_id')->unsigned()->nullable();
$table->string('trainingName'); $table->foreign('fire_station_id')->references('id')->on('fire_stations')->onDelete('cascade');
$table->string('training_name');
$table->timestamps(); $table->timestamps();
$table->softDeletes();
}); });
} }

View File

@ -13,13 +13,16 @@ class CreateTrainingsFireFightersTable extends Migration
*/ */
public function up() public function up()
{ {
Schema::create('trainingsFirefighters', function (Blueprint $table) { Schema::create('trainings_firefighters', function (Blueprint $table) {
$table->increments('id'); $table->increments('id');
$table->integer('firefighterID'); $table->integer('user_id')->unsigned();
$table->integer('trainingID'); $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
$table->date('dateOfComplete'); $table->integer('training_id')->unsigned();
$table->date('dateOfExpiry'); $table->foreign('training_id')->references('id')->on('trainings')->onDelete('cascade');
$table->date('date_of_completion');
$table->date('date_of_expiry');
$table->boolean('lifetime'); $table->boolean('lifetime');
$table->integer('editor_id')->nullable()->default(null);
$table->timestamps(); $table->timestamps();
}); });
} }
@ -31,6 +34,6 @@ class CreateTrainingsFireFightersTable extends Migration
*/ */
public function down() public function down()
{ {
Schema::dropIfExists('trainingsFirefighters'); Schema::dropIfExists('trainings_firefighters');
} }
} }

View File

@ -1,32 +0,0 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddSoftdeleteColumnToTrainingsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('trainings', function (Blueprint $table) {
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('trainings', function (Blueprint $table) {
//
});
}
}

View File

@ -1,33 +0,0 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddStatusToVehiclesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('vehicles', function (Blueprint $table) {
//
$table->integer('status')->default('0');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('vehicles', function (Blueprint $table) {
//
});
}
}

View File

@ -14,20 +14,9 @@ class CreateDecorationsTable extends Migration
public function up() public function up()
{ {
Schema::create('decorations', function (Blueprint $table) { Schema::create('decorations', function (Blueprint $table) {
$table->integer('id'); $table->increments('id');
$table->string('decorationName'); $table->string('decoration_name');
}); });
DB::table('decorations')->insert([ 'id' => '1', 'decorationName' => 'Odznaka "Młodzieżowa Drużyna Pożarnicza" - brązowa' ]);
DB::table('decorations')->insert([ 'id' => '2', 'decorationName' => 'Odznaka "Młodzieżowa Drużyna Pożarnicza" - srebrna' ]);
DB::table('decorations')->insert([ 'id' => '3', 'decorationName' => 'Odznaka "Młodzieżowa Drużyna Pożarnicza" - złota' ]);
DB::table('decorations')->insert([ 'id' => '4', 'decorationName' => 'Odznaka "Za wysługę lat"' ]);
DB::table('decorations')->insert([ 'id' => '5', 'decorationName' => 'Odznaka "Strażak Wzorowy"' ]);
DB::table('decorations')->insert([ 'id' => '6', 'decorationName' => 'Medal "Za Zasługi dla Pożarnictwa" - brązowy' ]);
DB::table('decorations')->insert([ 'id' => '7', 'decorationName' => 'Medal "Za Zasługi dla Pożarnictwa" - srebrny' ]);
DB::table('decorations')->insert([ 'id' => '8', 'decorationName' => 'Medal "Za Zasługi dla Pożarnictwa" - złoty' ]);
DB::table('decorations')->insert([ 'id' => '9', 'decorationName' => 'Medal Honorowy im. Bolesława Chomicza' ]);
DB::table('decorations')->insert([ 'id' => '10', 'decorationName' => 'Złoty Znak Związku Ochotniczych Straży Pożarnych Rzeczypospolitej Polskiej' ]);
} }
/** /**

View File

@ -13,13 +13,16 @@ class CreateDecorationsFirefightersTable extends Migration
*/ */
public function up() public function up()
{ {
Schema::create('decorationsFirefighters', function (Blueprint $table) { Schema::create('decorations_firefighters', function (Blueprint $table) {
$table->increments('id'); $table->increments('id');
$table->integer('firefighterID'); $table->integer('user_id')->unsigned();
$table->integer('decorationID'); $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
$table->date('dateOfAward'); $table->integer('decoration_id')->unsigned();
$table->softDeletes(); $table->foreign('decoration_id')->references('id')->on('decorations')->onDelete('cascade');
$table->date('date_of_award');
$table->integer('editor_id')->nullable()->default(null);
$table->timestamps(); $table->timestamps();
$table->softDeletes();
}); });
} }
@ -30,6 +33,6 @@ class CreateDecorationsFirefightersTable extends Migration
*/ */
public function down() public function down()
{ {
Schema::dropIfExists('decorationsFirefighters'); Schema::dropIfExists('decorations_firefighters');
} }
} }

View File

@ -1,35 +0,0 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddTrainingsNecessaryForOperations extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('trainings', function (Blueprint $table) {
});
//szkolenia niezbędne w każdej jednostce, określają kto może uczestniczyć w wyjazdach w jakie roli
DB::table('trainings')->insert([ 'id' => '1', 'fireStationID' => '0', 'trainingName' => 'szkolenie podstawowe' ]);
DB::table('trainings')->insert([ 'id' => '2', 'fireStationID' => '0', 'trainingName' => 'dowódca' ]);
DB::table('trainings')->insert([ 'id' => '3', 'fireStationID' => '0', 'trainingName' => 'kierowca-mechanik' ]);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('trainings', function (Blueprint $table) {
//
});
}
}

View File

@ -1,47 +0,0 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddAdditionalDataAboutFirefighters extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('users', function (Blueprint $table) {
//
$table->string('secondName', 45)->nullable()->default(null);
$table->string('fathersName', 45)->nullable()->default(null);
$table->string('mothersName', 45)->nullable()->default(null);
$table->string('address', 45)->nullable()->default(null);
$table->string('apartment', 45)->nullable()->default(null); //nr domu
$table->string('placeOfBirth', 45)->nullable()->default(null);
$table->string('driversLicense', 20)->nullable()->default(null);
$table->date('joiningOSPDate', 20)->nullable()->default(null);
$table->string('IDSeries', 3)->nullable()->default(null);
$table->string('IDNumber', 6)->nullable()->default(null); //nr dowodu osobistego
$table->date('IDValidUntil', 20)->nullable()->default(null);
$table->string('identityCardNumber', 20)->nullable()->default(null); //nr legitymacji strażackiej
$table->string('homePhoneNumber', 20)->nullable()->default(null);
$table->string('education', 45)->nullable()->default(null);
$table->string('profession', 45)->nullable()->default(null);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}

View File

@ -4,7 +4,7 @@ use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Migrations\Migration;
class AddSoftDeletesToOperationsTable extends Migration class CreateProvincesTable extends Migration
{ {
/** /**
* Run the migrations. * Run the migrations.
@ -13,8 +13,9 @@ class AddSoftDeletesToOperationsTable extends Migration
*/ */
public function up() public function up()
{ {
Schema::table('operations', function (Blueprint $table) { Schema::create('provinces', function (Blueprint $table) {
$table->softDeletes(); $table->increments('id');
$table->string('name');
}); });
} }
@ -25,8 +26,6 @@ class AddSoftDeletesToOperationsTable extends Migration
*/ */
public function down() public function down()
{ {
Schema::table('operations', function (Blueprint $table) { Schema::dropIfExists('provinces');
//
});
} }
} }

View File

@ -0,0 +1,33 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateDistrictsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('districts', function (Blueprint $table) {
$table->increments('id');
$table->integer('province_id')->unsigned();
$table->foreign('province_id')->references('id')->on('provinces')->onDelete('cascade');
$table->string('name');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('districts');
}
}

View File

@ -0,0 +1,35 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateCommunesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('communes', function (Blueprint $table) {
$table->increments('id');
$table->integer('province_id')->unsigned();
$table->foreign('province_id')->references('id')->on('provinces')->onDelete('cascade');
$table->integer('district_id')->unsigned();
$table->foreign('district_id')->references('id')->on('districts')->onDelete('cascade');
$table->string('name');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('communes');
}
}

View File

@ -1,35 +0,0 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddTrainingsNecessaryForOperations extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('trainings', function (Blueprint $table) {
});
//szkolenia niezbędne w każdej jednostce, określają kto może uczestniczyć w wyjazdach w jakie roli
DB::table('trainings')->insert([ 'id' => '1', 'fireStationID' => '0', 'trainingName' => 'szkolenie podstawowe' ]);
DB::table('trainings')->insert([ 'id' => '2', 'fireStationID' => '0', 'trainingName' => 'dowódca' ]);
DB::table('trainings')->insert([ 'id' => '3', 'fireStationID' => '0', 'trainingName' => 'kierowca-mechanik' ]);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('trainings', function (Blueprint $table) {
//
});
}
}

View File

@ -1,47 +0,0 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddAdditionalDataAboutFirefighters extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('users', function (Blueprint $table) {
//
$table->string('secondName', 45)->nullable()->default(null);
$table->string('fathersName', 45)->nullable()->default(null);
$table->string('mothersName', 45)->nullable()->default(null);
$table->string('address', 45)->nullable()->default(null);
$table->string('apartment', 45)->nullable()->default(null); //nr domu
$table->string('placeOfBirth', 45)->nullable()->default(null);
$table->string('driversLicense', 20)->nullable()->default(null);
$table->date('joiningOSPDate', 20)->nullable()->default(null);
$table->string('IDSeries', 3)->nullable()->default(null);
$table->string('IDNumber', 6)->nullable()->default(null); //nr dowodu osobistego
$table->date('IDValidUntil', 20)->nullable()->default(null);
$table->string('identityCardNumber', 20)->nullable()->default(null); //nr legitymacji strażackiej
$table->string('homePhoneNumber', 20)->nullable()->default(null);
$table->string('education', 45)->nullable()->default(null);
$table->string('profession', 45)->nullable()->default(null);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}