Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
5cab2a87
Commit
5cab2a87
authored
Jan 27, 2014
by
Alexander Makarov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes #2156: `yii migrate` now automatically creates `migrations` directory if it does not exist
parent
fcf1de7e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
CHANGELOG.md
framework/CHANGELOG.md
+1
-0
MigrateController.php
framework/console/controllers/MigrateController.php
+4
-2
No files found.
framework/CHANGELOG.md
View file @
5cab2a87
...
@@ -93,6 +93,7 @@ Yii Framework 2 Change Log
...
@@ -93,6 +93,7 @@ Yii Framework 2 Change Log
-
Enh #2124: Added support for UNION ALL queries (Ivan Pomortsev, iworker)
-
Enh #2124: Added support for UNION ALL queries (Ivan Pomortsev, iworker)
-
Enh #2132: Allow url of CSS and JS files registered in yii
\w
eb
\V
iew to be url alias (cebe)
-
Enh #2132: Allow url of CSS and JS files registered in yii
\w
eb
\V
iew to be url alias (cebe)
-
Enh #2144:
`Html`
helper now supports rendering "data" attributes (qiangxue)
-
Enh #2144:
`Html`
helper now supports rendering "data" attributes (qiangxue)
-
Enh #2156:
`yii migrate`
now automatically creates
`migrations`
directory if it does not exist (samdark)
-
Enh: Added
`favicon.ico`
and
`robots.txt`
to default application templates (samdark)
-
Enh: Added
`favicon.ico`
and
`robots.txt`
to default application templates (samdark)
-
Enh: Added
`Widget::autoIdPrefix`
to support prefixing automatically generated widget IDs (qiangxue)
-
Enh: Added
`Widget::autoIdPrefix`
to support prefixing automatically generated widget IDs (qiangxue)
-
Enh: Support for file aliases in console command 'message' (omnilight)
-
Enh: Support for file aliases in console command 'message' (omnilight)
...
...
framework/console/controllers/MigrateController.php
View file @
5cab2a87
...
@@ -14,6 +14,7 @@ use yii\console\Controller;
...
@@ -14,6 +14,7 @@ use yii\console\Controller;
use
yii\db\Connection
;
use
yii\db\Connection
;
use
yii\db\Query
;
use
yii\db\Query
;
use
yii\helpers\ArrayHelper
;
use
yii\helpers\ArrayHelper
;
use
yii\helpers\FileHelper
;
/**
/**
* This command manages application migrations.
* This command manages application migrations.
...
@@ -105,15 +106,16 @@ class MigrateController extends Controller
...
@@ -105,15 +106,16 @@ class MigrateController extends Controller
* This method is invoked right before an action is to be executed (after all possible filters.)
* This method is invoked right before an action is to be executed (after all possible filters.)
* It checks the existence of the [[migrationPath]].
* It checks the existence of the [[migrationPath]].
* @param \yii\base\Action $action the action to be executed.
* @param \yii\base\Action $action the action to be executed.
* @throws Exception if db component isn't configured
* @return boolean whether the action should continue to be executed.
* @return boolean whether the action should continue to be executed.
* @throws Exception if the migration directory does not exist.
*/
*/
public
function
beforeAction
(
$action
)
public
function
beforeAction
(
$action
)
{
{
if
(
parent
::
beforeAction
(
$action
))
{
if
(
parent
::
beforeAction
(
$action
))
{
$path
=
Yii
::
getAlias
(
$this
->
migrationPath
);
$path
=
Yii
::
getAlias
(
$this
->
migrationPath
);
if
(
!
is_dir
(
$path
))
{
if
(
!
is_dir
(
$path
))
{
throw
new
Exception
(
"The migration directory
\"
{
$path
}
\"
does not exist."
);
echo
""
;
FileHelper
::
createDirectory
(
$path
);
}
}
$this
->
migrationPath
=
$path
;
$this
->
migrationPath
=
$path
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment