Skip to content

Commit 82b3cbc

Browse files
committed
Minor fixes
1 parent 4a43c53 commit 82b3cbc

File tree

3 files changed

+53
-3
lines changed

3 files changed

+53
-3
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,17 @@ This file is a running track of new features and fixes to each version of the pa
33

44
This project follows [Semantic Versioning](http://semver.org) guidelines.
55

6+
## v0.6.0-pre.6 (Courageous Carniadactylus)
7+
### Fixed
8+
* `[pre.5]` — Console based server rebuild tool now actually rebuilds the servers with the correct information.
9+
* `[pre.5]` — Fixes typo and wrong docker contaienr for certain applications.
10+
11+
### Changed
12+
* Removed all old theme JS and CSS folders to cleanup and avoid confusion in the future.
13+
14+
### Added
15+
* `[pre.5]` — Added foreign key to `pack_id` to ensure nothing eds up breaking there.
16+
617
## v0.6.0-pre.5 (Courageous Carniadactylus)
718
### Changed
819
* New theme applied to Admin CP. Many graphical changes were made, some data was moved around and some display data changed. Too much was changed to feasibly log it all in here. Major breaking changes or notable new features will be logged.

app/Console/Commands/RebuildServer.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,18 @@ public function __construct()
6565
public function handle()
6666
{
6767
if ($this->option('all')) {
68-
$servers = Server::with('node', 'option.variables')->get();
68+
$servers = Server::all();
6969
} elseif ($this->option('node')) {
70-
$servers = Server::with('node', 'option.variables')->where('node_id', $this->option('node'))->get();
70+
$servers = Server::where('node_id', $this->option('node'))->get();
7171
} elseif ($this->option('server')) {
72-
$servers = Server::with('node', 'option.variables')->where('id', $this->option('server'))->get();
72+
$servers = Server::where('id', $this->option('server'))->get();
7373
} else {
7474
$this->error('You must pass a flag to determine which server(s) to rebuild.');
7575
return;
7676
}
7777

78+
$servers->load('node', 'service', 'option.variables', 'pack');
79+
7880
$this->line('Beginning processing, do not exit this script.');
7981
$bar = $this->output->createProgressBar(count($servers));
8082
$results = collect([]);
@@ -98,6 +100,11 @@ public function handle()
98100
'image' => $server->image,
99101
'env|overwrite' => $environment->pluck('value', 'variable')->merge(['STARTUP' => $server->startup]),
100102
],
103+
'service' => [
104+
'type' => $server->service->folder,
105+
'option' => $server->option->tag,
106+
'pack' => ! is_null($server->pack) ? $server->pack->uuid : null,
107+
],
101108
],
102109
]);
103110

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
3+
use Illuminate\Support\Facades\Schema;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Database\Migrations\Migration;
6+
7+
class AddForeignKeyToPacks extends Migration
8+
{
9+
/**
10+
* Run the migrations.
11+
*
12+
* @return void
13+
*/
14+
public function up()
15+
{
16+
Schema::table('servers', function (Blueprint $table) {
17+
$table->foreign('pack_id')->references('id')->on('packs');
18+
});
19+
}
20+
21+
/**
22+
* Reverse the migrations.
23+
*
24+
* @return void
25+
*/
26+
public function down()
27+
{
28+
Schema::table('servers', function (Blueprint $table) {
29+
$table->dropForeign(['pack_id']);
30+
});
31+
}
32+
}

0 commit comments

Comments
 (0)