From 82b3cbc24694a39b4dd8649f2d0d571c89b9bca2 Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Sat, 18 Mar 2017 20:52:02 -0400 Subject: [PATCH] Minor fixes --- CHANGELOG.md | 11 +++++++ app/Console/Commands/RebuildServer.php | 13 ++++++-- ...2017_03_18_204953_AddForeignKeyToPacks.php | 32 +++++++++++++++++++ 3 files changed, 53 insertions(+), 3 deletions(-) create mode 100644 database/migrations/2017_03_18_204953_AddForeignKeyToPacks.php diff --git a/CHANGELOG.md b/CHANGELOG.md index 61256e7cd..4606a4ad8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,17 @@ This file is a running track of new features and fixes to each version of the pa This project follows [Semantic Versioning](http://semver.org) guidelines. +## v0.6.0-pre.6 (Courageous Carniadactylus) +### Fixed +* `[pre.5]` — Console based server rebuild tool now actually rebuilds the servers with the correct information. +* `[pre.5]` — Fixes typo and wrong docker contaienr for certain applications. + +### Changed +* Removed all old theme JS and CSS folders to cleanup and avoid confusion in the future. + +### Added +* `[pre.5]` — Added foreign key to `pack_id` to ensure nothing eds up breaking there. + ## v0.6.0-pre.5 (Courageous Carniadactylus) ### Changed * 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. diff --git a/app/Console/Commands/RebuildServer.php b/app/Console/Commands/RebuildServer.php index 499bcfd6e..7581a72ac 100644 --- a/app/Console/Commands/RebuildServer.php +++ b/app/Console/Commands/RebuildServer.php @@ -65,16 +65,18 @@ class RebuildServer extends Command public function handle() { if ($this->option('all')) { - $servers = Server::with('node', 'option.variables')->get(); + $servers = Server::all(); } elseif ($this->option('node')) { - $servers = Server::with('node', 'option.variables')->where('node_id', $this->option('node'))->get(); + $servers = Server::where('node_id', $this->option('node'))->get(); } elseif ($this->option('server')) { - $servers = Server::with('node', 'option.variables')->where('id', $this->option('server'))->get(); + $servers = Server::where('id', $this->option('server'))->get(); } else { $this->error('You must pass a flag to determine which server(s) to rebuild.'); return; } + $servers->load('node', 'service', 'option.variables', 'pack'); + $this->line('Beginning processing, do not exit this script.'); $bar = $this->output->createProgressBar(count($servers)); $results = collect([]); @@ -98,6 +100,11 @@ class RebuildServer extends Command 'image' => $server->image, 'env|overwrite' => $environment->pluck('value', 'variable')->merge(['STARTUP' => $server->startup]), ], + 'service' => [ + 'type' => $server->service->folder, + 'option' => $server->option->tag, + 'pack' => ! is_null($server->pack) ? $server->pack->uuid : null, + ], ], ]); diff --git a/database/migrations/2017_03_18_204953_AddForeignKeyToPacks.php b/database/migrations/2017_03_18_204953_AddForeignKeyToPacks.php new file mode 100644 index 000000000..0271616a0 --- /dev/null +++ b/database/migrations/2017_03_18_204953_AddForeignKeyToPacks.php @@ -0,0 +1,32 @@ +foreign('pack_id')->references('id')->on('packs'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('servers', function (Blueprint $table) { + $table->dropForeign(['pack_id']); + }); + } +}