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>
This commit is contained in:
parent
c277f77f8f
commit
d7603c07fd
@ -15,25 +15,43 @@ class CreateUsersTable extends Migration
|
||||
{
|
||||
Schema::create('users', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('password', 100);
|
||||
$table->string('name', 45);
|
||||
$table->string('surname', 45);
|
||||
$table->string('password');
|
||||
$table->string('name');
|
||||
$table->string('surname');
|
||||
$table->string('PESEL',11);
|
||||
$table->string('phoneNumber', 9);
|
||||
$table->string('email', 50)->unique();
|
||||
$table->integer('fireStationID')->nullable();
|
||||
$table->integer('functionID');
|
||||
$table->integer('degreeID');
|
||||
$table->string('number', 45)->nullable()->default(null);
|
||||
$table->integer('statusID')->default(0);
|
||||
$table->integer('deleted')->default(0);
|
||||
$table->integer('creatorID')->nullable()->default(null);
|
||||
$table->integer('changingID')->nullable()->default(null);
|
||||
$table->string('phoneNumber', 20);
|
||||
$table->string('email', 100)->unique();
|
||||
$table->integer('fire_station_id')->unsigned()->nullable();
|
||||
$table->foreign('fire_station_id')->references('id')->on('fire_stations')->onDelete('cascade');
|
||||
$table->integer('unit_function_id')->unsigned()->nullable();
|
||||
$table->foreign('unit_function_id')->references('id')->on('unit_functions')->onDelete('set null');
|
||||
$table->integer('rank_id')->unsigned()->nullable();
|
||||
$table->foreign('rank_id')->references('id')->on('ranks')->onDelete('set null');
|
||||
$table->string('number')->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->string('confirmation_code')->nullable();
|
||||
$table->timestamp('email_verified_at')->nullable();
|
||||
$table->rememberToken();
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -13,25 +13,28 @@ class CreateFireStationsTable extends Migration
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('fireStations', function (Blueprint $table) {
|
||||
Schema::create('fire_stations', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('name', 45);
|
||||
$table->string('name');
|
||||
$table->integer('number');
|
||||
$table->string('voivodeship', 45);
|
||||
$table->string('county', 45);
|
||||
$table->string('community', 45);
|
||||
$table->string('postOffice', 45);
|
||||
$table->string('zipCode', 6);
|
||||
$table->string('address', 45);
|
||||
$table->integer('province_id')->unsigned();
|
||||
$table->foreign('province_id')->references('id')->on('provinces');
|
||||
$table->integer('district_id')->unsigned();
|
||||
$table->foreign('district_id')->references('id')->on('districts');
|
||||
$table->integer('commune_id')->unsigned();
|
||||
$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('longitude', 9,5);
|
||||
$table->string('KRS', 10);
|
||||
$table->string('NIP', 10);
|
||||
$table->string('phoneNumber', 11);
|
||||
$table->string('email', 100);
|
||||
$table->string('phone_number', 20);
|
||||
$table->string('email');
|
||||
$table->integer('deleted')->default(0);
|
||||
$table->integer('creatorID')->nullable()->default(null);
|
||||
$table->integer('changingID')->nullable()->default(null);
|
||||
$table->integer('creator_id')->nullable()->default(null);
|
||||
$table->integer('editor_id')->nullable()->default(null);
|
||||
$table->rememberToken();
|
||||
$table->timestamps();
|
||||
});
|
||||
@ -44,6 +47,6 @@ class CreateFireStationsTable extends Migration
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('fireStations');
|
||||
Schema::dropIfExists('fire_stations');
|
||||
}
|
||||
}
|
||||
|
@ -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');
|
||||
}
|
||||
}
|
@ -14,18 +14,9 @@ class CreateRanksTable extends Migration
|
||||
public function up()
|
||||
{
|
||||
Schema::create('ranks', function (Blueprint $table) {
|
||||
$table->integer('id');
|
||||
$table->string('rank', 60);
|
||||
$table->increments('id');
|
||||
$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' ]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -13,18 +13,10 @@ class CreateUnitFunctionsTable extends Migration
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('unitFunctions', function (Blueprint $table) {
|
||||
$table->integer('id');
|
||||
$table->string('unitFunction', 60);
|
||||
Schema::create('unit_functions', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$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()
|
||||
{
|
||||
Schema::dropIfExists('unitFunctions');
|
||||
Schema::dropIfExists('unit_functions');
|
||||
}
|
||||
}
|
||||
|
@ -15,29 +15,32 @@ class CreateVehiclesTable extends Migration
|
||||
{
|
||||
Schema::create('vehicles', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->integer('fireStationID');
|
||||
$table->string('name', 45);
|
||||
$table->string('codename', 45);
|
||||
$table->string('brand',45)->nullable();
|
||||
$table->string('registrationNumber', 15)->nullable();
|
||||
$table->integer('productionYear')->nullable();
|
||||
$table->date('examExpirationDate')->nullable(); //Data ważności przegladu
|
||||
$table->date('insuranceExpirationDate')->nullable();
|
||||
$table->string('driveType',45)->nullable(); //układ napędowy
|
||||
$table->string('chassisType',45)->nullable(); //typ podwozia
|
||||
$table->string('bodyProducer',45)->nullable(); //producent nadwozia
|
||||
$table->integer('crewNumber')->nullable();
|
||||
$table->integer('foamAgent')->nullable(); //Ilość środka pianotwórczego w litrach
|
||||
$table->integer('enginePower')->nullable(); //Moc silnika w kW
|
||||
$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('chassisNumber')->nullable();
|
||||
$table->string('engineNumber')->nullable();
|
||||
$table->string('fuelType',45)->nullable();
|
||||
$table->integer('chassisPoductionYear')->nullable();
|
||||
$table->date('entryIntoServiceDate')->nullable();
|
||||
$table->string('fireEnginePumpDescription')->nullable();// Opis autopompy
|
||||
$table->softDeletes();
|
||||
$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();
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -15,14 +15,18 @@ class CreateOperationsTable extends Migration
|
||||
{
|
||||
Schema::create('operations', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->dateTime('operationDate');
|
||||
$table->string('location', 100);
|
||||
$table->string('target', 100);
|
||||
$table->string('dangerType', 100);
|
||||
$table->integer('fire_station_id')->unsigned();
|
||||
$table->foreign('fire_station_id')->references('id')->on('fire_stations')->onDelete('cascade');
|
||||
$table->dateTime('operation_date');
|
||||
$table->string('location');
|
||||
$table->string('target');
|
||||
$table->string('danger_type');
|
||||
$table->longtext('description');
|
||||
$table->integer('commanderID');
|
||||
$table->softDeletes();
|
||||
$table->integer('commander_id')->unsigned();
|
||||
$table->foreign('commander_id')->references('id')->on('users');
|
||||
$table->integer('editor_id')->nullable()->default(null);
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -13,11 +13,14 @@ class CreateOperationsTrucksTable extends Migration
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('operationsTrucks', function (Blueprint $table) {
|
||||
Schema::create('operations_vehicles', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->integer('operationID');
|
||||
$table->integer('truckID');
|
||||
$table->integer('driverID');
|
||||
$table->integer('operation_id')->unsigned();
|
||||
$table->foreign('operation_id')->references('id')->on('operations')->onDelete('cascade');
|
||||
$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();
|
||||
});
|
||||
}
|
||||
@ -29,6 +32,6 @@ class CreateOperationsTrucksTable extends Migration
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('operationsTrucks');
|
||||
Schema::dropIfExists('operations_vehicles');
|
||||
}
|
||||
}
|
||||
|
@ -13,11 +13,13 @@ class CreateOperationsMembersTable extends Migration
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('operationsMembers', function (Blueprint $table) {
|
||||
Schema::create('operations_members', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->integer('operationID');
|
||||
$table->integer('memberID');
|
||||
$table->boolean('privateTransport');
|
||||
$table->integer('operation_id')->unsigned();
|
||||
$table->foreign('operation_id')->references('id')->on('operations')->onDelete('cascade');
|
||||
$table->integer('member_id')->unsigned();
|
||||
$table->foreign('member_id')->references('id')->on('users');
|
||||
$table->boolean('private_transport');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
@ -29,6 +31,6 @@ class CreateOperationsMembersTable extends Migration
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('operationsMembers');
|
||||
Schema::dropIfExists('operations_members');
|
||||
}
|
||||
}
|
||||
|
@ -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) {
|
||||
//
|
||||
});
|
||||
}
|
||||
}
|
@ -15,12 +15,14 @@ class CreateEquipmentTable extends Migration
|
||||
{
|
||||
Schema::create('equipment', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->integer('fireStationID');
|
||||
$table->string('name', 45);
|
||||
$table->integer('fire_station_id')->unsigned();
|
||||
$table->foreign('fire_station_id')->references('id')->on('fire_stations')->onDelete('cascade');
|
||||
$table->string('name');
|
||||
$table->integer('amount');
|
||||
$table->string('parameter', 45)->nullable();
|
||||
$table->softDeletes();
|
||||
$table->string('parameter')->nullable();
|
||||
$table->integer('editor_id')->nullable()->default(null);
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -15,9 +15,11 @@ class CreateTrainingsTable extends Migration
|
||||
{
|
||||
Schema::create('trainings', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->integer('fireStationID');
|
||||
$table->string('trainingName');
|
||||
$table->integer('fire_station_id')->unsigned()->nullable();
|
||||
$table->foreign('fire_station_id')->references('id')->on('fire_stations')->onDelete('cascade');
|
||||
$table->string('training_name');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -13,13 +13,16 @@ class CreateTrainingsFireFightersTable extends Migration
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('trainingsFirefighters', function (Blueprint $table) {
|
||||
Schema::create('trainings_firefighters', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->integer('firefighterID');
|
||||
$table->integer('trainingID');
|
||||
$table->date('dateOfComplete');
|
||||
$table->date('dateOfExpiry');
|
||||
$table->integer('user_id')->unsigned();
|
||||
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
||||
$table->integer('training_id')->unsigned();
|
||||
$table->foreign('training_id')->references('id')->on('trainings')->onDelete('cascade');
|
||||
$table->date('date_of_completion');
|
||||
$table->date('date_of_expiry');
|
||||
$table->boolean('lifetime');
|
||||
$table->integer('editor_id')->nullable()->default(null);
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
@ -31,6 +34,6 @@ class CreateTrainingsFireFightersTable extends Migration
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('trainingsFirefighters');
|
||||
Schema::dropIfExists('trainings_firefighters');
|
||||
}
|
||||
}
|
||||
|
@ -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) {
|
||||
//
|
||||
});
|
||||
}
|
||||
}
|
@ -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) {
|
||||
//
|
||||
});
|
||||
}
|
||||
}
|
@ -14,20 +14,9 @@ class CreateDecorationsTable extends Migration
|
||||
public function up()
|
||||
{
|
||||
Schema::create('decorations', function (Blueprint $table) {
|
||||
$table->integer('id');
|
||||
$table->string('decorationName');
|
||||
});
|
||||
|
||||
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' ]);
|
||||
$table->increments('id');
|
||||
$table->string('decoration_name');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -13,13 +13,16 @@ class CreateDecorationsFirefightersTable extends Migration
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('decorationsFirefighters', function (Blueprint $table) {
|
||||
Schema::create('decorations_firefighters', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->integer('firefighterID');
|
||||
$table->integer('decorationID');
|
||||
$table->date('dateOfAward');
|
||||
$table->softDeletes();
|
||||
$table->integer('user_id')->unsigned();
|
||||
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
||||
$table->integer('decoration_id')->unsigned();
|
||||
$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->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
@ -30,6 +33,6 @@ class CreateDecorationsFirefightersTable extends Migration
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('decorationsFirefighters');
|
||||
Schema::dropIfExists('decorations_firefighters');
|
||||
}
|
||||
}
|
||||
|
@ -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) {
|
||||
//
|
||||
});
|
||||
}
|
||||
}
|
@ -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()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
@ -4,7 +4,7 @@ use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddSoftDeletesToOperationsTable extends Migration
|
||||
class CreateProvincesTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
@ -13,8 +13,9 @@ class AddSoftDeletesToOperationsTable extends Migration
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('operations', function (Blueprint $table) {
|
||||
$table->softDeletes();
|
||||
Schema::create('provinces', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('name');
|
||||
});
|
||||
}
|
||||
|
||||
@ -25,8 +26,6 @@ class AddSoftDeletesToOperationsTable extends Migration
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('operations', function (Blueprint $table) {
|
||||
//
|
||||
});
|
||||
Schema::dropIfExists('provinces');
|
||||
}
|
||||
}
|
@ -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');
|
||||
}
|
||||
}
|
@ -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');
|
||||
}
|
||||
}
|
@ -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) {
|
||||
//
|
||||
});
|
||||
}
|
||||
}
|
@ -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()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user