Type Groups
This commit is contained in:
parent
9fdfe9dfb1
commit
27410bf5c2
17
controllers/AircraftTypeGroups.php
Normal file
17
controllers/AircraftTypeGroups.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php namespace GermanAirlinesVa\Fleet\Controllers;
|
||||
|
||||
use Backend\Classes\Controller;
|
||||
use BackendMenu;
|
||||
|
||||
class AircraftTypeGroups extends Controller
|
||||
{
|
||||
public $implement = [ 'Backend\Behaviors\ListController', 'Backend\Behaviors\FormController' ];
|
||||
|
||||
public $listConfig = 'config_list.yaml';
|
||||
public $formConfig = 'config_form.yaml';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
}
|
||||
18
controllers/aircrafttypegroups/_list_toolbar.htm
Normal file
18
controllers/aircrafttypegroups/_list_toolbar.htm
Normal file
@ -0,0 +1,18 @@
|
||||
<div data-control="toolbar">
|
||||
<a href="<?= Backend::url('germanairlinesva/fleet/aircrafttypegroups/create') ?>" class="btn btn-primary oc-icon-plus"><?= e(trans('backend::lang.form.create')) ?></a>
|
||||
<button
|
||||
class="btn btn-default oc-icon-trash-o"
|
||||
disabled="disabled"
|
||||
onclick="$(this).data('request-data', {
|
||||
checked: $('.control-list').listWidget('getChecked')
|
||||
})"
|
||||
data-request="onDelete"
|
||||
data-request-confirm="<?= e(trans('backend::lang.list.delete_selected_confirm')) ?>"
|
||||
data-trigger-action="enable"
|
||||
data-trigger=".control-list input[type=checkbox]"
|
||||
data-trigger-condition="checked"
|
||||
data-request-success="$(this).prop('disabled', true)"
|
||||
data-stripe-load-indicator>
|
||||
<?= e(trans('backend::lang.list.delete_selected')) ?>
|
||||
</button>
|
||||
</div>
|
||||
10
controllers/aircrafttypegroups/config_form.yaml
Normal file
10
controllers/aircrafttypegroups/config_form.yaml
Normal file
@ -0,0 +1,10 @@
|
||||
name: AircraftTypeGroups
|
||||
form: $/germanairlinesva/fleet/models/aircrafttypegroup/fields.yaml
|
||||
modelClass: GermanAirlinesVa\Fleet\Models\AircraftTypeGroup
|
||||
defaultRedirect: germanairlinesva/fleet/aircrafttypegroups
|
||||
create:
|
||||
redirect: 'germanairlinesva/fleet/aircrafttypegroups/update/:id'
|
||||
redirectClose: germanairlinesva/fleet/aircrafttypegroups
|
||||
update:
|
||||
redirect: germanairlinesva/fleet/aircrafttypegroups
|
||||
redirectClose: germanairlinesva/fleet/aircrafttypegroups
|
||||
12
controllers/aircrafttypegroups/config_list.yaml
Normal file
12
controllers/aircrafttypegroups/config_list.yaml
Normal file
@ -0,0 +1,12 @@
|
||||
list: $/germanairlinesva/fleet/models/aircrafttypegroup/columns.yaml
|
||||
modelClass: GermanAirlinesVa\Fleet\Models\AircraftTypeGroup
|
||||
title: AircraftTypeGroups
|
||||
noRecordsMessage: 'backend::lang.list.no_records'
|
||||
showSetup: true
|
||||
showCheckboxes: true
|
||||
recordsPerPage: 20
|
||||
toolbar:
|
||||
buttons: list_toolbar
|
||||
search:
|
||||
prompt: 'backend::lang.list.search_prompt'
|
||||
recordUrl: 'germanairlinesva/fleet/aircrafttypegroups/update/:id'
|
||||
46
controllers/aircrafttypegroups/create.htm
Normal file
46
controllers/aircrafttypegroups/create.htm
Normal file
@ -0,0 +1,46 @@
|
||||
<?php Block::put('breadcrumb') ?>
|
||||
<ul>
|
||||
<li><a href="<?= Backend::url('germanairlinesva/fleet/aircrafttypegroups') ?>">AircraftTypeGroups</a></li>
|
||||
<li><?= e($this->pageTitle) ?></li>
|
||||
</ul>
|
||||
<?php Block::endPut() ?>
|
||||
|
||||
<?php if (!$this->fatalError): ?>
|
||||
|
||||
<?= Form::open(['class' => 'layout']) ?>
|
||||
|
||||
<div class="layout-row">
|
||||
<?= $this->formRender() ?>
|
||||
</div>
|
||||
|
||||
<div class="form-buttons">
|
||||
<div class="loading-indicator-container">
|
||||
<button
|
||||
type="submit"
|
||||
data-request="onSave"
|
||||
data-hotkey="ctrl+s, cmd+s"
|
||||
data-load-indicator="<?= e(trans('backend::lang.form.saving')) ?>"
|
||||
class="btn btn-primary">
|
||||
<?= e(trans('backend::lang.form.create')) ?>
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
data-request="onSave"
|
||||
data-request-data="close:1"
|
||||
data-hotkey="ctrl+enter, cmd+enter"
|
||||
data-load-indicator="<?= e(trans('backend::lang.form.saving')) ?>"
|
||||
class="btn btn-default">
|
||||
<?= e(trans('backend::lang.form.create_and_close')) ?>
|
||||
</button>
|
||||
<span class="btn-text">
|
||||
<?= e(trans('backend::lang.form.or')) ?> <a href="<?= Backend::url('germanairlinesva/fleet/aircrafttypegroups') ?>"><?= e(trans('backend::lang.form.cancel')) ?></a>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?= Form::close() ?>
|
||||
|
||||
<?php else: ?>
|
||||
<p class="flash-message static error"><?= e(trans($this->fatalError)) ?></p>
|
||||
<p><a href="<?= Backend::url('germanairlinesva/fleet/aircrafttypegroups') ?>" class="btn btn-default"><?= e(trans('backend::lang.form.return_to_list')) ?></a></p>
|
||||
<?php endif ?>
|
||||
1
controllers/aircrafttypegroups/index.htm
Normal file
1
controllers/aircrafttypegroups/index.htm
Normal file
@ -0,0 +1 @@
|
||||
<?= $this->listRender() ?>
|
||||
22
controllers/aircrafttypegroups/preview.htm
Normal file
22
controllers/aircrafttypegroups/preview.htm
Normal file
@ -0,0 +1,22 @@
|
||||
<?php Block::put('breadcrumb') ?>
|
||||
<ul>
|
||||
<li><a href="<?= Backend::url('germanairlinesva/fleet/aircrafttypegroups') ?>">AircraftTypeGroups</a></li>
|
||||
<li><?= e($this->pageTitle) ?></li>
|
||||
</ul>
|
||||
<?php Block::endPut() ?>
|
||||
|
||||
<?php if (!$this->fatalError): ?>
|
||||
|
||||
<div class="form-preview">
|
||||
<?= $this->formRenderPreview() ?>
|
||||
</div>
|
||||
|
||||
<?php else: ?>
|
||||
<p class="flash-message static error"><?= e($this->fatalError) ?></p>
|
||||
<?php endif ?>
|
||||
|
||||
<p>
|
||||
<a href="<?= Backend::url('germanairlinesva/fleet/aircrafttypegroups') ?>" class="btn btn-default oc-icon-chevron-left">
|
||||
<?= e(trans('backend::lang.form.return_to_list')) ?>
|
||||
</a>
|
||||
</p>
|
||||
54
controllers/aircrafttypegroups/update.htm
Normal file
54
controllers/aircrafttypegroups/update.htm
Normal file
@ -0,0 +1,54 @@
|
||||
<?php Block::put('breadcrumb') ?>
|
||||
<ul>
|
||||
<li><a href="<?= Backend::url('germanairlinesva/fleet/aircrafttypegroups') ?>">AircraftTypeGroups</a></li>
|
||||
<li><?= e($this->pageTitle) ?></li>
|
||||
</ul>
|
||||
<?php Block::endPut() ?>
|
||||
|
||||
<?php if (!$this->fatalError): ?>
|
||||
|
||||
<?= Form::open(['class' => 'layout']) ?>
|
||||
|
||||
<div class="layout-row">
|
||||
<?= $this->formRender() ?>
|
||||
</div>
|
||||
|
||||
<div class="form-buttons">
|
||||
<div class="loading-indicator-container">
|
||||
<button
|
||||
type="submit"
|
||||
data-request="onSave"
|
||||
data-request-data="redirect:0"
|
||||
data-hotkey="ctrl+s, cmd+s"
|
||||
data-load-indicator="<?= e(trans('backend::lang.form.saving')) ?>"
|
||||
class="btn btn-primary">
|
||||
<?= e(trans('backend::lang.form.save')) ?>
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
data-request="onSave"
|
||||
data-request-data="close:1"
|
||||
data-hotkey="ctrl+enter, cmd+enter"
|
||||
data-load-indicator="<?= e(trans('backend::lang.form.saving')) ?>"
|
||||
class="btn btn-default">
|
||||
<?= e(trans('backend::lang.form.save_and_close')) ?>
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="oc-icon-trash-o btn-icon danger pull-right"
|
||||
data-request="onDelete"
|
||||
data-load-indicator="<?= e(trans('backend::lang.form.deleting')) ?>"
|
||||
data-request-confirm="<?= e(trans('backend::lang.form.confirm_delete')) ?>">
|
||||
</button>
|
||||
|
||||
<span class="btn-text">
|
||||
<?= e(trans('backend::lang.form.or')) ?> <a href="<?= Backend::url('germanairlinesva/fleet/aircrafttypegroups') ?>"><?= e(trans('backend::lang.form.cancel')) ?></a>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<?= Form::close() ?>
|
||||
|
||||
<?php else: ?>
|
||||
<p class="flash-message static error"><?= e(trans($this->fatalError)) ?></p>
|
||||
<p><a href="<?= Backend::url('germanairlinesva/fleet/aircrafttypegroups') ?>" class="btn btn-default"><?= e(trans('backend::lang.form.return_to_list')) ?></a></p>
|
||||
<?php endif ?>
|
||||
@ -15,5 +15,6 @@
|
||||
'manufacturers' => 'Aircraft Manufacturers',
|
||||
'types' => 'Aircraft Types',
|
||||
'aircrafts' => 'Aircrafts',
|
||||
'groups' => 'Aircraft Type Groups',
|
||||
],
|
||||
];
|
||||
@ -18,7 +18,6 @@ class Aircraft extends Model
|
||||
/**
|
||||
* @var string The database table used by the model.
|
||||
*/
|
||||
//public $table = 'germanairlinesva_fleet_aircrafts';
|
||||
public $table = 'aircrafts';
|
||||
protected $connection = 'germanairlinesva_fleet';
|
||||
|
||||
|
||||
@ -18,7 +18,6 @@ class AircraftManufacturer extends Model
|
||||
/**
|
||||
* @var string The database table used by the model.
|
||||
*/
|
||||
// public $table = 'germanairlinesva_fleet_aircraft_manufacturers';
|
||||
public $table = 'aircraft_manufacturers';
|
||||
protected $connection = 'germanairlinesva_fleet';
|
||||
|
||||
|
||||
@ -18,7 +18,6 @@ class AircraftType extends Model
|
||||
/**
|
||||
* @var string The database table used by the model.
|
||||
*/
|
||||
// public $table = 'germanairlinesva_fleet_aircraft_types';
|
||||
public $table = 'aircraft_types';
|
||||
protected $connection = 'germanairlinesva_fleet';
|
||||
|
||||
@ -31,6 +30,10 @@ class AircraftType extends Model
|
||||
'aircraft_manufacturer' => 'GermanAirlinesVa\Fleet\Models\AircraftManufacturer',
|
||||
];
|
||||
|
||||
public $belongsToMany = [
|
||||
'aircraft_type_groups' => 'GermanAirlinesVa\Fleet\Models\AircraftTypeGroup',
|
||||
];
|
||||
|
||||
public $hasMany = [
|
||||
'aircrafts' => 'GermanAirlinesVa\Fleet\Models\Aircraft',
|
||||
];
|
||||
|
||||
32
models/AircraftTypeGroup.php
Normal file
32
models/AircraftTypeGroup.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?php namespace GermanAirlinesVa\Fleet\Models;
|
||||
|
||||
use Model;
|
||||
|
||||
/**
|
||||
* Model
|
||||
*/
|
||||
class AircraftTypeGroup extends Model
|
||||
{
|
||||
use \October\Rain\Database\Traits\Validation;
|
||||
|
||||
/*
|
||||
* Disable timestamps by default.
|
||||
* Remove this line if timestamps are defined in the database table.
|
||||
*/
|
||||
public $timestamps = false;
|
||||
|
||||
/**
|
||||
* @var string The database table used by the model.
|
||||
*/
|
||||
public $table = 'aircraft_type_groups';
|
||||
protected $connection = 'germanairlinesva_fleet';
|
||||
|
||||
/**
|
||||
* @var array Validation rules
|
||||
*/
|
||||
public $rules = [];
|
||||
|
||||
public $belongsToMany = [
|
||||
'aircraft_types' => 'GermanAirlinesVa\Fleet\Models\AircraftType',
|
||||
];
|
||||
}
|
||||
@ -1,137 +1,145 @@
|
||||
tabs:
|
||||
fields:
|
||||
aircraft_manufacturer:
|
||||
label: Manufacturer
|
||||
nameFrom: name
|
||||
descriptionFrom: description
|
||||
span: auto
|
||||
required: 1
|
||||
type: relation
|
||||
tab: Operational
|
||||
typerating_id:
|
||||
label: Typerating
|
||||
span: auto
|
||||
required: 1
|
||||
type: number
|
||||
tab: Operational
|
||||
only_charter:
|
||||
label: 'Charter Only'
|
||||
span: auto
|
||||
required: 1
|
||||
type: switch
|
||||
tab: Operational
|
||||
type:
|
||||
label: Type
|
||||
span: auto
|
||||
required: 1
|
||||
type: text
|
||||
tab: Operational
|
||||
simbrief_type:
|
||||
label: 'SimBrief Type'
|
||||
span: auto
|
||||
required: 1
|
||||
type: text
|
||||
tab: Operational
|
||||
dom:
|
||||
label: DOM
|
||||
span: auto
|
||||
required: 1
|
||||
type: number
|
||||
tab: Weights
|
||||
mpld:
|
||||
label: 'Max Payload'
|
||||
span: auto
|
||||
required: 1
|
||||
type: number
|
||||
tab: Weights
|
||||
mzfm:
|
||||
label: 'Max ZFM'
|
||||
span: auto
|
||||
required: 1
|
||||
type: number
|
||||
tab: Weights
|
||||
fuel_capacity:
|
||||
label: 'Fuel Capacity'
|
||||
span: auto
|
||||
required: 1
|
||||
type: number
|
||||
tab: Weights
|
||||
mtom:
|
||||
label: 'Max TOM'
|
||||
span: auto
|
||||
required: 1
|
||||
type: number
|
||||
tab: Weights
|
||||
mlam:
|
||||
label: 'Max LAM'
|
||||
span: auto
|
||||
required: 1
|
||||
type: number
|
||||
tab: Weights
|
||||
description:
|
||||
label: Description
|
||||
size: large
|
||||
span: auto
|
||||
required: 1
|
||||
type: richeditor
|
||||
tab: Informational
|
||||
wingspan:
|
||||
label: Wingspan
|
||||
span: auto
|
||||
required: 1
|
||||
type: text
|
||||
tab: Informational
|
||||
length:
|
||||
label: Length
|
||||
span: auto
|
||||
required: 1
|
||||
type: text
|
||||
tab: Informational
|
||||
cruise_speed:
|
||||
label: 'Cruise Speed'
|
||||
span: auto
|
||||
required: 1
|
||||
type: text
|
||||
tab: Informational
|
||||
range:
|
||||
label: Range
|
||||
span: auto
|
||||
required: 1
|
||||
type: text
|
||||
tab: Informational
|
||||
engines:
|
||||
label: Engines
|
||||
span: auto
|
||||
required: 1
|
||||
type: text
|
||||
tab: Informational
|
||||
max_fl:
|
||||
label: 'Max FL'
|
||||
span: auto
|
||||
required: 1
|
||||
type: number
|
||||
tab: Informational
|
||||
capacity_flight_crew:
|
||||
label: 'Flight Crew'
|
||||
span: auto
|
||||
required: 1
|
||||
type: number
|
||||
tab: Informational
|
||||
capacity_cabin_crew:
|
||||
label: 'Cabin Crew'
|
||||
span: auto
|
||||
required: 1
|
||||
type: number
|
||||
tab: Informational
|
||||
capacity_passengers:
|
||||
label: Passengers
|
||||
span: auto
|
||||
required: 1
|
||||
type: number
|
||||
tab: Informational
|
||||
capacity_cargo:
|
||||
label: Cargo
|
||||
span: auto
|
||||
required: 1
|
||||
type: number
|
||||
tab: Informational
|
||||
fields:
|
||||
aircraft_manufacturer:
|
||||
label: Manufacturer
|
||||
nameFrom: name
|
||||
descriptionFrom: description
|
||||
span: auto
|
||||
required: 1
|
||||
type: relation
|
||||
tab: Operational
|
||||
typerating_id:
|
||||
label: Typerating
|
||||
span: auto
|
||||
required: 1
|
||||
type: number
|
||||
tab: Operational
|
||||
only_charter:
|
||||
label: 'Charter Only'
|
||||
span: auto
|
||||
required: 1
|
||||
type: switch
|
||||
tab: Operational
|
||||
type:
|
||||
label: Type
|
||||
span: auto
|
||||
required: 1
|
||||
type: text
|
||||
tab: Operational
|
||||
simbrief_type:
|
||||
label: 'SimBrief Type'
|
||||
span: auto
|
||||
required: 1
|
||||
type: text
|
||||
tab: Operational
|
||||
aircraft_type_groups:
|
||||
label: 'Aircraft Type Groups'
|
||||
nameFrom: comment
|
||||
descriptionFrom: description
|
||||
span: auto
|
||||
required: 1
|
||||
type: relation
|
||||
tab: Operational
|
||||
dom:
|
||||
label: DOM
|
||||
span: auto
|
||||
required: 1
|
||||
type: number
|
||||
tab: Weights
|
||||
mpld:
|
||||
label: 'Max Payload'
|
||||
span: auto
|
||||
required: 1
|
||||
type: number
|
||||
tab: Weights
|
||||
mzfm:
|
||||
label: 'Max ZFM'
|
||||
span: auto
|
||||
required: 1
|
||||
type: number
|
||||
tab: Weights
|
||||
fuel_capacity:
|
||||
label: 'Fuel Capacity'
|
||||
span: auto
|
||||
required: 1
|
||||
type: number
|
||||
tab: Weights
|
||||
mtom:
|
||||
label: 'Max TOM'
|
||||
span: auto
|
||||
required: 1
|
||||
type: number
|
||||
tab: Weights
|
||||
mlam:
|
||||
label: 'Max LAM'
|
||||
span: auto
|
||||
required: 1
|
||||
type: number
|
||||
tab: Weights
|
||||
description:
|
||||
label: Description
|
||||
size: large
|
||||
span: auto
|
||||
required: 1
|
||||
type: richeditor
|
||||
tab: Informational
|
||||
wingspan:
|
||||
label: Wingspan
|
||||
span: auto
|
||||
required: 1
|
||||
type: text
|
||||
tab: Informational
|
||||
length:
|
||||
label: Length
|
||||
span: auto
|
||||
required: 1
|
||||
type: text
|
||||
tab: Informational
|
||||
cruise_speed:
|
||||
label: 'Cruise Speed'
|
||||
span: auto
|
||||
required: 1
|
||||
type: text
|
||||
tab: Informational
|
||||
range:
|
||||
label: Range
|
||||
span: auto
|
||||
required: 1
|
||||
type: text
|
||||
tab: Informational
|
||||
engines:
|
||||
label: Engines
|
||||
span: auto
|
||||
required: 1
|
||||
type: text
|
||||
tab: Informational
|
||||
max_fl:
|
||||
label: 'Max FL'
|
||||
span: auto
|
||||
required: 1
|
||||
type: number
|
||||
tab: Informational
|
||||
capacity_flight_crew:
|
||||
label: 'Flight Crew'
|
||||
span: auto
|
||||
required: 1
|
||||
type: number
|
||||
tab: Informational
|
||||
capacity_cabin_crew:
|
||||
label: 'Cabin Crew'
|
||||
span: auto
|
||||
required: 1
|
||||
type: number
|
||||
tab: Informational
|
||||
capacity_passengers:
|
||||
label: Passengers
|
||||
span: auto
|
||||
required: 1
|
||||
type: number
|
||||
tab: Informational
|
||||
capacity_cargo:
|
||||
label: Cargo
|
||||
span: auto
|
||||
required: 1
|
||||
type: number
|
||||
tab: Informational
|
||||
|
||||
7
models/aircrafttypegroup/columns.yaml
Normal file
7
models/aircrafttypegroup/columns.yaml
Normal file
@ -0,0 +1,7 @@
|
||||
columns:
|
||||
id:
|
||||
label: id
|
||||
type: number
|
||||
comment:
|
||||
label: comment
|
||||
type: text
|
||||
5
models/aircrafttypegroup/fields.yaml
Normal file
5
models/aircrafttypegroup/fields.yaml
Normal file
@ -0,0 +1,5 @@
|
||||
fields:
|
||||
comment:
|
||||
label: Comment
|
||||
span: auto
|
||||
type: text
|
||||
@ -22,3 +22,7 @@ navigation:
|
||||
label: 'germanairlinesva.fleet::lang.menu.aircrafts'
|
||||
url: germanairlinesva/fleet/aircrafts
|
||||
icon: icon-plane
|
||||
side-menu-item4:
|
||||
label: 'germanairlinesva.fleet::lang.menu.groups'
|
||||
url: germanairlinesva/fleet/aircrafttypegroups
|
||||
icon: icon-group
|
||||
|
||||
@ -9,7 +9,6 @@ class BuilderTableCreateGermanAirlinesVaAircraftManufacturers extends Migration
|
||||
public function up()
|
||||
{
|
||||
Schema::connection('germanairlinesva_fleet')->create('aircraft_manufacturers', function ($table) {
|
||||
//Schema::create('germanairlinesva_fleet_aircraft_manufacturers', function ($table) {
|
||||
$table->engine = 'InnoDB';
|
||||
$table->bigIncrements('id')->unsigned();
|
||||
$table->string('name');
|
||||
@ -21,6 +20,5 @@ class BuilderTableCreateGermanAirlinesVaAircraftManufacturers extends Migration
|
||||
public function down()
|
||||
{
|
||||
Schema::connection('germanairlinesva_fleet')->dropIfExists('aircraft_manufacturers');
|
||||
//Schema::dropIfExists('germanairlinesva_fleet_aircraft_manufacturers');
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,31 @@
|
||||
<?php namespace GermanAirlinesVa\Fleet\Updates;
|
||||
|
||||
use Schema;
|
||||
use October\Rain\Database\Updates\Migration;
|
||||
|
||||
class BuilderTableCreateGermanAirlinesVaFleetAircraftTypesAircraftTypeGroups extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
Schema::connection('germanairlinesva_fleet')->create('aircraft_type_aircraft_type_group', function ($table) {
|
||||
$table->engine = 'InnoDB';
|
||||
$table->bigInteger('aircraft_type_id')->unsigned();
|
||||
$table
|
||||
->foreign('aircraft_type_id')
|
||||
->references('id')
|
||||
->on('aircraft_types');
|
||||
$table->bigInteger('aircraft_type_group_id')->unsigned();
|
||||
$table
|
||||
->foreign('aircraft_type_group_id')
|
||||
->references('id')
|
||||
->on('aircraft_type_groups');
|
||||
});
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
Schema::connection('germanairlinesva_fleet')->disableForeignKeyConstraints();
|
||||
Schema::connection('germanairlinesva_fleet')->dropIfExists('aircraft_type_aircraft_type_group');
|
||||
Schema::connection('germanairlinesva_fleet')->enableForeignKeyConstraints();
|
||||
}
|
||||
}
|
||||
21
updates/builder_table_create_aircraft_type_groups.php
Normal file
21
updates/builder_table_create_aircraft_type_groups.php
Normal file
@ -0,0 +1,21 @@
|
||||
<?php namespace GermanAirlinesVa\Fleet\Updates;
|
||||
|
||||
use Schema;
|
||||
use October\Rain\Database\Updates\Migration;
|
||||
|
||||
class BuilderTableCreateGermanAirlinesVaFleetAircraftTypeGroups extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
Schema::connection('germanairlinesva_fleet')->create('aircraft_type_groups', function ($table) {
|
||||
$table->engine = 'InnoDB';
|
||||
$table->bigIncrements('id')->unsigned();
|
||||
$table->string('comment');
|
||||
});
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
Schema::connection('germanairlinesva_fleet')->dropIfExists('aircraft_type_groups');
|
||||
}
|
||||
}
|
||||
@ -9,7 +9,6 @@ class BuilderTableCreateGermanAirlinesVaAircraftTypes extends Migration
|
||||
public function up()
|
||||
{
|
||||
Schema::connection('germanairlinesva_fleet')->create('aircraft_types', function ($table) {
|
||||
//Schema::create('germanairlinesva_fleet_aircraft_types', function ($table) {
|
||||
$table->engine = 'InnoDB';
|
||||
$table->bigIncrements('id')->unsigned();
|
||||
$table->bigInteger('aircraft_manufacturer_id')->unsigned();
|
||||
@ -47,7 +46,8 @@ class BuilderTableCreateGermanAirlinesVaAircraftTypes extends Migration
|
||||
|
||||
public function down()
|
||||
{
|
||||
Schema::connection('germanairlinesva_fleet')->disableForeignKeyConstraints();
|
||||
Schema::connection('germanairlinesva_fleet')->dropIfExists('aircraft_types');
|
||||
//Schema::dropIfExists('germanairlinesva_fleet_aircraft_types');
|
||||
Schema::connection('germanairlinesva_fleet')->enableForeignKeyConstraints();
|
||||
}
|
||||
}
|
||||
|
||||
@ -8,7 +8,6 @@ class BuilderTableCreateGermanAirlinesVaFleetAircrafts extends Migration
|
||||
public function up()
|
||||
{
|
||||
Schema::connection('germanairlinesva_fleet')->create('aircrafts', function ($table) {
|
||||
//Schema::create('germanairlinesva_fleet_aircrafts', function ($table) {
|
||||
$table->engine = 'InnoDB';
|
||||
$table->bigIncrements('id')->unsigned();
|
||||
$table->bigInteger('aircraft_type_id')->unsigned();
|
||||
@ -58,7 +57,8 @@ class BuilderTableCreateGermanAirlinesVaFleetAircrafts extends Migration
|
||||
|
||||
public function down()
|
||||
{
|
||||
Schema::connection('germanairlinesva_fleet')->disableForeignKeyConstraints();
|
||||
Schema::connection('germanairlinesva_fleet')->dropIfExists('aircrafts');
|
||||
//Schema::dropIfExists('germanairlinesva_fleet_aircrafts');
|
||||
Schema::connection('germanairlinesva_fleet')->enableForeignKeyConstraints();
|
||||
}
|
||||
}
|
||||
@ -7,3 +7,7 @@
|
||||
- builder_table_create_aircraft_types.php
|
||||
- 'Created table aircrafts'
|
||||
- builder_table_create_aircrafts.php
|
||||
- 'Created table aircraft_type_groups'
|
||||
- builder_table_create_aircraft_type_groups.php
|
||||
- 'Created table aircraft_type_aircraft_type_group'
|
||||
- builder_table_create_aircraft_type_aircraft_type_group.php
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user