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',
|
'manufacturers' => 'Aircraft Manufacturers',
|
||||||
'types' => 'Aircraft Types',
|
'types' => 'Aircraft Types',
|
||||||
'aircrafts' => 'Aircrafts',
|
'aircrafts' => 'Aircrafts',
|
||||||
|
'groups' => 'Aircraft Type Groups',
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
@ -18,7 +18,6 @@ class Aircraft extends Model
|
|||||||
/**
|
/**
|
||||||
* @var string The database table used by the model.
|
* @var string The database table used by the model.
|
||||||
*/
|
*/
|
||||||
//public $table = 'germanairlinesva_fleet_aircrafts';
|
|
||||||
public $table = 'aircrafts';
|
public $table = 'aircrafts';
|
||||||
protected $connection = 'germanairlinesva_fleet';
|
protected $connection = 'germanairlinesva_fleet';
|
||||||
|
|
||||||
|
|||||||
@ -18,7 +18,6 @@ class AircraftManufacturer extends Model
|
|||||||
/**
|
/**
|
||||||
* @var string The database table used by the model.
|
* @var string The database table used by the model.
|
||||||
*/
|
*/
|
||||||
// public $table = 'germanairlinesva_fleet_aircraft_manufacturers';
|
|
||||||
public $table = 'aircraft_manufacturers';
|
public $table = 'aircraft_manufacturers';
|
||||||
protected $connection = 'germanairlinesva_fleet';
|
protected $connection = 'germanairlinesva_fleet';
|
||||||
|
|
||||||
|
|||||||
@ -18,7 +18,6 @@ class AircraftType extends Model
|
|||||||
/**
|
/**
|
||||||
* @var string The database table used by the model.
|
* @var string The database table used by the model.
|
||||||
*/
|
*/
|
||||||
// public $table = 'germanairlinesva_fleet_aircraft_types';
|
|
||||||
public $table = 'aircraft_types';
|
public $table = 'aircraft_types';
|
||||||
protected $connection = 'germanairlinesva_fleet';
|
protected $connection = 'germanairlinesva_fleet';
|
||||||
|
|
||||||
@ -31,6 +30,10 @@ class AircraftType extends Model
|
|||||||
'aircraft_manufacturer' => 'GermanAirlinesVa\Fleet\Models\AircraftManufacturer',
|
'aircraft_manufacturer' => 'GermanAirlinesVa\Fleet\Models\AircraftManufacturer',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
public $belongsToMany = [
|
||||||
|
'aircraft_type_groups' => 'GermanAirlinesVa\Fleet\Models\AircraftTypeGroup',
|
||||||
|
];
|
||||||
|
|
||||||
public $hasMany = [
|
public $hasMany = [
|
||||||
'aircrafts' => 'GermanAirlinesVa\Fleet\Models\Aircraft',
|
'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:
|
tabs:
|
||||||
fields:
|
fields:
|
||||||
aircraft_manufacturer:
|
aircraft_manufacturer:
|
||||||
label: Manufacturer
|
label: Manufacturer
|
||||||
nameFrom: name
|
nameFrom: name
|
||||||
descriptionFrom: description
|
descriptionFrom: description
|
||||||
span: auto
|
span: auto
|
||||||
required: 1
|
required: 1
|
||||||
type: relation
|
type: relation
|
||||||
tab: Operational
|
tab: Operational
|
||||||
typerating_id:
|
typerating_id:
|
||||||
label: Typerating
|
label: Typerating
|
||||||
span: auto
|
span: auto
|
||||||
required: 1
|
required: 1
|
||||||
type: number
|
type: number
|
||||||
tab: Operational
|
tab: Operational
|
||||||
only_charter:
|
only_charter:
|
||||||
label: 'Charter Only'
|
label: 'Charter Only'
|
||||||
span: auto
|
span: auto
|
||||||
required: 1
|
required: 1
|
||||||
type: switch
|
type: switch
|
||||||
tab: Operational
|
tab: Operational
|
||||||
type:
|
type:
|
||||||
label: Type
|
label: Type
|
||||||
span: auto
|
span: auto
|
||||||
required: 1
|
required: 1
|
||||||
type: text
|
type: text
|
||||||
tab: Operational
|
tab: Operational
|
||||||
simbrief_type:
|
simbrief_type:
|
||||||
label: 'SimBrief Type'
|
label: 'SimBrief Type'
|
||||||
span: auto
|
span: auto
|
||||||
required: 1
|
required: 1
|
||||||
type: text
|
type: text
|
||||||
tab: Operational
|
tab: Operational
|
||||||
dom:
|
aircraft_type_groups:
|
||||||
label: DOM
|
label: 'Aircraft Type Groups'
|
||||||
span: auto
|
nameFrom: comment
|
||||||
required: 1
|
descriptionFrom: description
|
||||||
type: number
|
span: auto
|
||||||
tab: Weights
|
required: 1
|
||||||
mpld:
|
type: relation
|
||||||
label: 'Max Payload'
|
tab: Operational
|
||||||
span: auto
|
dom:
|
||||||
required: 1
|
label: DOM
|
||||||
type: number
|
span: auto
|
||||||
tab: Weights
|
required: 1
|
||||||
mzfm:
|
type: number
|
||||||
label: 'Max ZFM'
|
tab: Weights
|
||||||
span: auto
|
mpld:
|
||||||
required: 1
|
label: 'Max Payload'
|
||||||
type: number
|
span: auto
|
||||||
tab: Weights
|
required: 1
|
||||||
fuel_capacity:
|
type: number
|
||||||
label: 'Fuel Capacity'
|
tab: Weights
|
||||||
span: auto
|
mzfm:
|
||||||
required: 1
|
label: 'Max ZFM'
|
||||||
type: number
|
span: auto
|
||||||
tab: Weights
|
required: 1
|
||||||
mtom:
|
type: number
|
||||||
label: 'Max TOM'
|
tab: Weights
|
||||||
span: auto
|
fuel_capacity:
|
||||||
required: 1
|
label: 'Fuel Capacity'
|
||||||
type: number
|
span: auto
|
||||||
tab: Weights
|
required: 1
|
||||||
mlam:
|
type: number
|
||||||
label: 'Max LAM'
|
tab: Weights
|
||||||
span: auto
|
mtom:
|
||||||
required: 1
|
label: 'Max TOM'
|
||||||
type: number
|
span: auto
|
||||||
tab: Weights
|
required: 1
|
||||||
description:
|
type: number
|
||||||
label: Description
|
tab: Weights
|
||||||
size: large
|
mlam:
|
||||||
span: auto
|
label: 'Max LAM'
|
||||||
required: 1
|
span: auto
|
||||||
type: richeditor
|
required: 1
|
||||||
tab: Informational
|
type: number
|
||||||
wingspan:
|
tab: Weights
|
||||||
label: Wingspan
|
description:
|
||||||
span: auto
|
label: Description
|
||||||
required: 1
|
size: large
|
||||||
type: text
|
span: auto
|
||||||
tab: Informational
|
required: 1
|
||||||
length:
|
type: richeditor
|
||||||
label: Length
|
tab: Informational
|
||||||
span: auto
|
wingspan:
|
||||||
required: 1
|
label: Wingspan
|
||||||
type: text
|
span: auto
|
||||||
tab: Informational
|
required: 1
|
||||||
cruise_speed:
|
type: text
|
||||||
label: 'Cruise Speed'
|
tab: Informational
|
||||||
span: auto
|
length:
|
||||||
required: 1
|
label: Length
|
||||||
type: text
|
span: auto
|
||||||
tab: Informational
|
required: 1
|
||||||
range:
|
type: text
|
||||||
label: Range
|
tab: Informational
|
||||||
span: auto
|
cruise_speed:
|
||||||
required: 1
|
label: 'Cruise Speed'
|
||||||
type: text
|
span: auto
|
||||||
tab: Informational
|
required: 1
|
||||||
engines:
|
type: text
|
||||||
label: Engines
|
tab: Informational
|
||||||
span: auto
|
range:
|
||||||
required: 1
|
label: Range
|
||||||
type: text
|
span: auto
|
||||||
tab: Informational
|
required: 1
|
||||||
max_fl:
|
type: text
|
||||||
label: 'Max FL'
|
tab: Informational
|
||||||
span: auto
|
engines:
|
||||||
required: 1
|
label: Engines
|
||||||
type: number
|
span: auto
|
||||||
tab: Informational
|
required: 1
|
||||||
capacity_flight_crew:
|
type: text
|
||||||
label: 'Flight Crew'
|
tab: Informational
|
||||||
span: auto
|
max_fl:
|
||||||
required: 1
|
label: 'Max FL'
|
||||||
type: number
|
span: auto
|
||||||
tab: Informational
|
required: 1
|
||||||
capacity_cabin_crew:
|
type: number
|
||||||
label: 'Cabin Crew'
|
tab: Informational
|
||||||
span: auto
|
capacity_flight_crew:
|
||||||
required: 1
|
label: 'Flight Crew'
|
||||||
type: number
|
span: auto
|
||||||
tab: Informational
|
required: 1
|
||||||
capacity_passengers:
|
type: number
|
||||||
label: Passengers
|
tab: Informational
|
||||||
span: auto
|
capacity_cabin_crew:
|
||||||
required: 1
|
label: 'Cabin Crew'
|
||||||
type: number
|
span: auto
|
||||||
tab: Informational
|
required: 1
|
||||||
capacity_cargo:
|
type: number
|
||||||
label: Cargo
|
tab: Informational
|
||||||
span: auto
|
capacity_passengers:
|
||||||
required: 1
|
label: Passengers
|
||||||
type: number
|
span: auto
|
||||||
tab: Informational
|
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'
|
label: 'germanairlinesva.fleet::lang.menu.aircrafts'
|
||||||
url: germanairlinesva/fleet/aircrafts
|
url: germanairlinesva/fleet/aircrafts
|
||||||
icon: icon-plane
|
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()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::connection('germanairlinesva_fleet')->create('aircraft_manufacturers', function ($table) {
|
Schema::connection('germanairlinesva_fleet')->create('aircraft_manufacturers', function ($table) {
|
||||||
//Schema::create('germanairlinesva_fleet_aircraft_manufacturers', function ($table) {
|
|
||||||
$table->engine = 'InnoDB';
|
$table->engine = 'InnoDB';
|
||||||
$table->bigIncrements('id')->unsigned();
|
$table->bigIncrements('id')->unsigned();
|
||||||
$table->string('name');
|
$table->string('name');
|
||||||
@ -21,6 +20,5 @@ class BuilderTableCreateGermanAirlinesVaAircraftManufacturers extends Migration
|
|||||||
public function down()
|
public function down()
|
||||||
{
|
{
|
||||||
Schema::connection('germanairlinesva_fleet')->dropIfExists('aircraft_manufacturers');
|
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()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::connection('germanairlinesva_fleet')->create('aircraft_types', function ($table) {
|
Schema::connection('germanairlinesva_fleet')->create('aircraft_types', function ($table) {
|
||||||
//Schema::create('germanairlinesva_fleet_aircraft_types', function ($table) {
|
|
||||||
$table->engine = 'InnoDB';
|
$table->engine = 'InnoDB';
|
||||||
$table->bigIncrements('id')->unsigned();
|
$table->bigIncrements('id')->unsigned();
|
||||||
$table->bigInteger('aircraft_manufacturer_id')->unsigned();
|
$table->bigInteger('aircraft_manufacturer_id')->unsigned();
|
||||||
@ -47,7 +46,8 @@ class BuilderTableCreateGermanAirlinesVaAircraftTypes extends Migration
|
|||||||
|
|
||||||
public function down()
|
public function down()
|
||||||
{
|
{
|
||||||
|
Schema::connection('germanairlinesva_fleet')->disableForeignKeyConstraints();
|
||||||
Schema::connection('germanairlinesva_fleet')->dropIfExists('aircraft_types');
|
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()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::connection('germanairlinesva_fleet')->create('aircrafts', function ($table) {
|
Schema::connection('germanairlinesva_fleet')->create('aircrafts', function ($table) {
|
||||||
//Schema::create('germanairlinesva_fleet_aircrafts', function ($table) {
|
|
||||||
$table->engine = 'InnoDB';
|
$table->engine = 'InnoDB';
|
||||||
$table->bigIncrements('id')->unsigned();
|
$table->bigIncrements('id')->unsigned();
|
||||||
$table->bigInteger('aircraft_type_id')->unsigned();
|
$table->bigInteger('aircraft_type_id')->unsigned();
|
||||||
@ -58,7 +57,8 @@ class BuilderTableCreateGermanAirlinesVaFleetAircrafts extends Migration
|
|||||||
|
|
||||||
public function down()
|
public function down()
|
||||||
{
|
{
|
||||||
|
Schema::connection('germanairlinesva_fleet')->disableForeignKeyConstraints();
|
||||||
Schema::connection('germanairlinesva_fleet')->dropIfExists('aircrafts');
|
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
|
- builder_table_create_aircraft_types.php
|
||||||
- 'Created table aircrafts'
|
- 'Created table aircrafts'
|
||||||
- builder_table_create_aircrafts.php
|
- 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