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
166465ec
Commit
166465ec
authored
Jun 17, 2014
by
Klimov Paul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
`MigrationInterface` extracted
parent
6cc1310a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
3 deletions
+39
-3
BaseMigrateController.php
framework/console/controllers/BaseMigrateController.php
+1
-2
Migration.php
framework/db/Migration.php
+2
-1
MigrationInterface.php
framework/db/MigrationInterface.php
+36
-0
No files found.
framework/console/controllers/BaseMigrateController.php
View file @
166465ec
...
...
@@ -16,7 +16,6 @@ use yii\helpers\FileHelper;
* BaseMigrateController is base class for migrate controllers.
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @author Klimov Paul <klimov@zfort.com>
* @since 2.0
*/
abstract
class
BaseMigrateController
extends
Controller
...
...
@@ -528,7 +527,7 @@ abstract class BaseMigrateController extends Controller
/**
* Creates a new migration instance.
* @param string $class the migration class name
* @return \yii\db\Migration the migration instance
* @return \yii\db\Migration
Interface
the migration instance
*/
protected
function
createMigration
(
$class
)
{
...
...
framework/db/Migration.php
View file @
166465ec
...
...
@@ -8,6 +8,7 @@
namespace
yii\db
;
use
yii\di\Instance
;
use
\yii\base\Component
;
/**
* Migration is the base class for representing a database migration.
...
...
@@ -35,7 +36,7 @@ use yii\di\Instance;
* @author Qiang Xue <qiang.xue@gmail.com>
* @since 2.0
*/
class
Migration
extends
\yii\base\Component
class
Migration
extends
Component
implements
MigrationInterface
{
/**
* @var Connection|string the DB connection object or the application component ID of the DB connection
...
...
framework/db/MigrationInterface.php
0 → 100644
View file @
166465ec
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
namespace
yii\db
;
/**
* The MigrationInterface defines the minimum set of methods to be implemented by a database migration.
*
* Each migration class should provide the [[up()]] method containing the logic for "upgrading" the database
* and the [[down()]] method for the "downgrading" logic.
*
* @author Klimov Paul <klimov@zfort.com>
* @since 2.0
*/
interface
MigrationInterface
{
/**
* This method contains the logic to be executed when applying this migration.
* @return boolean return a false value to indicate the migration fails
* and should not proceed further. All other return values mean the migration succeeds.
*/
public
function
up
();
/**
* This method contains the logic to be executed when removing this migration.
* The default implementation throws an exception indicating the migration cannot be removed.
* @return boolean return a false value to indicate the migration fails
* and should not proceed further. All other return values mean the migration succeeds.
*/
public
function
down
();
}
\ No newline at end of file
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