Skip to content

Commit fecca0e

Browse files
committed
fix(database): error phinx not working
1 parent 373161e commit fecca0e

4 files changed

Lines changed: 7 additions & 3 deletions

File tree

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
"migrate:rollback": "vendor/bin/phinx rollback",
4646
"migrate:status": "vendor/bin/phinx status",
4747
"migrate:create": "vendor/bin/phinx create",
48-
"db:seed": "vendor/bin/phinx seed:run"
48+
"seed:create": "vendor/bin/phinx seed:create",
49+
"seed": "vendor/bin/phinx seed:run"
4950
}
5051
}

config/phinx.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,13 @@
1212
$default = $dbConfig['default'];
1313
$connections = $dbConfig['connections'];
1414

15+
// Đường dẫn tuyệt đối đến thư mục gốc của dự án
16+
$rootPath = dirname(__DIR__);
17+
1518
return [
1619
'paths' => [
17-
'migrations' => '%%PHINX_CONFIG_DIR%%/../database/migrations',
18-
'seeds' => '%%PHINX_CONFIG_DIR%%/../database/seeds',
20+
'migrations' => $rootPath . '/database/migrations',
21+
'seeds' => $rootPath . '/database/seeds',
1922
],
2023
'environments' => [
2124
'default_migration_table' => 'phinxlog',

database/migrations/.gitkeep

Whitespace-only changes.

database/seeds/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)