Skip to content

Commit 4aab32f

Browse files
committed
fix: patch up database dir
1 parent ee7b688 commit 4aab32f

7 files changed

Lines changed: 8 additions & 8 deletions

src/Commands/DatabaseDropCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ protected function handle()
1717

1818
$migrations = function_exists('AppPaths') ?
1919
glob(getcwd() . DIRECTORY_SEPARATOR . AppPaths('database') . DIRECTORY_SEPARATOR . '*.yml') :
20-
glob(getcwd() . DIRECTORY_SEPARATOR . 'database' . DIRECTORY_SEPARATOR . '*.yml');
20+
glob(getcwd() . DIRECTORY_SEPARATOR . 'app' . DIRECTORY_SEPARATOR . 'database' . DIRECTORY_SEPARATOR . '*.yml');
2121

2222
foreach ($migrations as $migration) {
2323
$currentFileName = path($migration)->basename();

src/Commands/DatabaseMigrationCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ protected function handle()
1818

1919
$migrations = function_exists('AppPaths') ?
2020
glob(getcwd() . DIRECTORY_SEPARATOR . AppPaths('database') . DIRECTORY_SEPARATOR . '*.yml') :
21-
glob(getcwd() . DIRECTORY_SEPARATOR . 'database' . DIRECTORY_SEPARATOR . '*.yml');
21+
glob(getcwd() . DIRECTORY_SEPARATOR . 'app' . DIRECTORY_SEPARATOR . 'database' . DIRECTORY_SEPARATOR . '*.yml');
2222

2323
if (empty($migrations)) {
2424
$this->error("No schema files found.");

src/Commands/DatabaseResetCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ protected function handle()
1818

1919
$migrations = function_exists('AppPaths') ?
2020
glob(getcwd() . DIRECTORY_SEPARATOR . AppPaths('database') . DIRECTORY_SEPARATOR . '*.yml') :
21-
glob(getcwd() . DIRECTORY_SEPARATOR . 'database' . DIRECTORY_SEPARATOR . '*.yml');
21+
glob(getcwd() . DIRECTORY_SEPARATOR . 'app' . DIRECTORY_SEPARATOR . 'database' . DIRECTORY_SEPARATOR . '*.yml');
2222

2323
foreach ($migrations as $migration) {
2424
$currentFileName = path($migration)->basename();

src/Commands/DatabaseRollbackCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ protected function handle()
1818

1919
$migrations = function_exists('AppPaths') ?
2020
glob(getcwd() . DIRECTORY_SEPARATOR . AppPaths('database') . DIRECTORY_SEPARATOR . '*.yml') :
21-
glob(getcwd() . DIRECTORY_SEPARATOR . 'database' . DIRECTORY_SEPARATOR . '*.yml');
21+
glob(getcwd() . DIRECTORY_SEPARATOR . 'app' . DIRECTORY_SEPARATOR . 'database' . DIRECTORY_SEPARATOR . '*.yml');
2222

2323
foreach ($migrations as $migration) {
2424
$currentFileName = path($migration)->basename();

src/Commands/DatabaseSeedCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ protected function handle()
1717

1818
$seeds = function_exists('AppPaths') ?
1919
glob(getcwd() . DIRECTORY_SEPARATOR . AppPaths('database') . DIRECTORY_SEPARATOR . '*.yml') :
20-
glob(getcwd() . DIRECTORY_SEPARATOR . 'database' . DIRECTORY_SEPARATOR . '*.yml');
20+
glob(getcwd() . DIRECTORY_SEPARATOR . 'app' . DIRECTORY_SEPARATOR . 'database' . DIRECTORY_SEPARATOR . '*.yml');
2121

2222
foreach ($seeds as $seed) {
2323
$currentFileName = path($seed)->basename();

src/Commands/DeleteSchemaCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ protected function handle()
2222

2323
$file = function_exists('DatabasePath') ?
2424
getcwd() . DIRECTORY_SEPARATOR . DatabasePath("$schema.yml") :
25-
getcwd() . DIRECTORY_SEPARATOR . 'database' . DIRECTORY_SEPARATOR . "$schema.yml";
25+
getcwd() . DIRECTORY_SEPARATOR . 'app' . DIRECTORY_SEPARATOR . 'database' . DIRECTORY_SEPARATOR . "$schema.yml";
2626

2727
if (!\Leaf\FS\File::exists($file)) {
2828
$this->error("$schema doesn't exist!");

src/Commands/GenerateSchemaCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ protected function handle()
2626

2727
$schemaFile = function_exists('DatabasePath') ?
2828
getcwd() . DIRECTORY_SEPARATOR . DatabasePath("$schema.yml") :
29-
getcwd() . DIRECTORY_SEPARATOR . 'database' . DIRECTORY_SEPARATOR . "$schema.yml";
29+
getcwd() . DIRECTORY_SEPARATOR . 'app' . DIRECTORY_SEPARATOR . 'database' . DIRECTORY_SEPARATOR . "$schema.yml";
3030

3131
if (file_exists($schemaFile)) {
3232
$this->error("$schema already exists");
@@ -36,7 +36,7 @@ protected function handle()
3636
if (
3737
\Leaf\FS\File::create($schemaFile, function () {
3838
return file_get_contents(__DIR__ . '/stubs/schema.stub');
39-
})
39+
}, ['recursive' => true])
4040
) {
4141
$this->comment("$schema schema file created successfully!");
4242
$this->generateExtraFiles($schema);

0 commit comments

Comments
 (0)