1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-05 09:34:05 +00:00

Re-create tmp dir as well if needed

This commit is contained in:
Samuel Štancl 2022-03-30 17:44:02 +02:00
parent c285f1faf4
commit f7d0451545
4 changed files with 13 additions and 3 deletions

View file

@ -23,8 +23,7 @@ class Migrate extends MigrateCommand
{
parent::__construct($migrator, $dispatcher);
// Add the --tenants option
$this->specifyParameters();
$this->specifyTenantSignature();
}
/**

View file

@ -37,7 +37,7 @@ class Rollback extends RollbackCommand
{
parent::__construct($migrator);
$this->specifyParameters();
$this->specifyTenantSignature();
}
/**

View file

@ -4,6 +4,12 @@ namespace Stancl\Tenancy\Concerns;
trait ExtendsLaravelCommand
{
protected function specifyTenantSignature(): void
{
$this->setName('tenants:migrate');
$this->specifyParameters();
}
public function getName(): ?string
{
return static::getDefaultName();

View file

@ -67,6 +67,11 @@ class QueueTest extends TestCase
$valueStorePath = __DIR__ . '/Etc/tmp/queuetest.json';
if (! file_exists($valueStorePath)) {
// The directory sometimes goes missing as well when the file is deleted in git
if (! is_dir(__DIR__ . '/Etc/tmp')) {
mkdir(__DIR__ . '/Etc/tmp');
}
file_put_contents($valueStorePath, '');
}