Skip to content

Commit

Permalink
Run migrations in production #patch
Browse files Browse the repository at this point in the history
  • Loading branch information
kennyturner committed Oct 8, 2024
1 parent 4da8405 commit b5dafd1
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions changelog/next.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- **BugFix**: Add `--force` to migrations action
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"illuminate/support": "^9.0 | ^10.0 | ^11.0",
"erusev/parsedown": "^1.7.0",
"wikimedia/composer-merge-plugin": "^2.0.1",
"laravel/prompts": "^0.1"
"laravel/prompts": "^0.1|^0.2|^0.3"
},
"require-dev": {
"laravel/pint": "^1.15",
Expand Down Expand Up @@ -60,4 +60,4 @@
]
}
}
}
}
2 changes: 1 addition & 1 deletion src/Actions/RunMigrationsAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class RunMigrationsAction
public function execute(bool $update = false)
{
$cmd = $update === true ? 'migrate' : 'migrate:fresh';
Artisan::call($cmd . " --no-interaction");
Artisan::call($cmd . " --no-interaction --force");
$output = Artisan::output();

return Str::of($output)
Expand Down
6 changes: 5 additions & 1 deletion src/Services/JsonService.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,18 @@
namespace AdminUI\AdminUIInstaller\Services;

use Illuminate\Support\Arr;
use Illuminate\Support\Facades\Storage;

class JsonService
{
protected string $file;

public function __construct()
{
$this->file = config('adminui-installer.root').'/resources/status.json';
$this->file = config('adminui-installer.root') . '/resources/status.json';
if (!Storage::exists($this->file)) {
Storage::put($this->file, json_encode($this->getDefault()));
}
}

private function getDefault()
Expand Down

0 comments on commit b5dafd1

Please sign in to comment.