2017-12-10 11:21:49 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use App\Models\Migrations\Migration;
|
|
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
|
|
|
|
|
|
class CreateSettingsTable extends Migration
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Run the migrations.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function up()
|
|
|
|
{
|
|
|
|
Schema::create('settings', function (Blueprint $table) {
|
|
|
|
$table->increments('id');
|
2017-12-13 03:33:18 +08:00
|
|
|
$table->unsignedInteger('order')->default(99);
|
2017-12-10 11:56:26 +08:00
|
|
|
$table->string('name');
|
2017-12-10 11:21:49 +08:00
|
|
|
$table->string('key');
|
|
|
|
$table->string('value');
|
2017-12-10 11:56:26 +08:00
|
|
|
$table->string('group')->nullable();
|
2017-12-13 03:26:08 +08:00
|
|
|
$table->string('type')->nullable();
|
|
|
|
$table->string('options')->nullable();
|
|
|
|
$table->string('description')->nullable();
|
2017-12-10 11:21:49 +08:00
|
|
|
$table->timestamps();
|
|
|
|
$table->unique('key');
|
|
|
|
});
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Initial default settings
|
|
|
|
*/
|
|
|
|
$settings = [
|
|
|
|
[
|
|
|
|
'order' => 1,
|
|
|
|
'name' => 'Start Date',
|
|
|
|
'group' => '',
|
|
|
|
'key' => 'general.start_date',
|
|
|
|
'value' => '',
|
|
|
|
'type' => 'date',
|
|
|
|
'description' => 'The date your VA started',
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'order' => 2,
|
|
|
|
'name' => 'Currency to Use',
|
|
|
|
'group' => 'general',
|
|
|
|
'key' => 'general.currency',
|
|
|
|
'value' => 'dollar',
|
|
|
|
'type' => 'text',
|
|
|
|
'options' => 'dollar,euro,gbp,yen,jpy,rupee,ruble',
|
|
|
|
'description' => 'Currency to show in the interface',
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'order' => 10,
|
|
|
|
'name' => 'Flights from Current',
|
|
|
|
'group' => 'flights',
|
|
|
|
'key' => 'flights.only_flights_from_current',
|
2017-12-13 01:57:52 +08:00
|
|
|
'value' => true,
|
2017-12-10 11:21:49 +08:00
|
|
|
'type' => 'boolean',
|
|
|
|
'description' => 'Only allow flights from current location',
|
|
|
|
],
|
2017-12-13 01:52:24 +08:00
|
|
|
[
|
2017-12-13 01:57:52 +08:00
|
|
|
'order' => 20,
|
2017-12-13 02:43:58 +08:00
|
|
|
'name' => 'Disable flight on bid',
|
2017-12-13 01:57:52 +08:00
|
|
|
'group' => 'bids',
|
|
|
|
'key' => 'bids.disable_flight_on_bid',
|
|
|
|
'value' => true,
|
2017-12-13 01:52:24 +08:00
|
|
|
'type' => 'boolean',
|
|
|
|
'description' => 'When a flight is bid on, should the flight be shown',
|
|
|
|
],
|
2017-12-10 11:21:49 +08:00
|
|
|
[
|
2017-12-13 01:57:52 +08:00
|
|
|
'order' => 21,
|
2017-12-13 01:52:24 +08:00
|
|
|
'name' => 'Allow multiple bids',
|
2017-12-13 01:57:52 +08:00
|
|
|
'group' => 'bids',
|
|
|
|
'key' => 'bids.allow_multiple_bids',
|
|
|
|
'value' => true,
|
2017-12-13 01:52:24 +08:00
|
|
|
'type' => 'boolean',
|
|
|
|
'description' => 'Whether or not someone can bid on multiple flights',
|
|
|
|
],
|
|
|
|
[
|
2017-12-13 01:57:52 +08:00
|
|
|
'order' => 30,
|
2017-12-10 11:21:49 +08:00
|
|
|
'name' => 'Hide Inactive Pilots',
|
|
|
|
'group' => 'pilots',
|
|
|
|
'key' => 'pilots.hide_inactive',
|
2017-12-13 01:57:52 +08:00
|
|
|
'value' => true,
|
2017-12-10 11:21:49 +08:00
|
|
|
'type' => 'boolean',
|
|
|
|
'description' => 'Don\'t show inactive pilots in the public view',
|
|
|
|
],
|
2017-12-13 02:43:58 +08:00
|
|
|
[
|
|
|
|
'order' => 31,
|
|
|
|
'name' => 'Pilot ID Length',
|
|
|
|
'group' => 'pilots',
|
|
|
|
'key' => 'pilots.id_length',
|
|
|
|
'value' => 4,
|
|
|
|
'type' => 'int',
|
|
|
|
'description' => 'The length of a pilot\'s ID',
|
|
|
|
],
|
2017-12-10 11:21:49 +08:00
|
|
|
];
|
|
|
|
|
|
|
|
$this->addData('settings', $settings);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Reverse the migrations.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function down()
|
|
|
|
{
|
2017-12-13 01:49:35 +08:00
|
|
|
Schema::dropIfExists('settings');
|
2017-12-10 11:21:49 +08:00
|
|
|
}
|
|
|
|
}
|