0 follower

Interface Yiisoft\Db\Migration\RevertibleMigrationInterface

ExtendsYiisoft\Db\Migration\MigrationInterface

The RevertibleMigrationInterface defines the minimum set of methods to be implemented by a revertible database migration.

Each migration class should provide the {@see \Yiisoft\Db\Migration\up()} method containing the logic for "upgrading" the database. and the {@see \Yiisoft\Db\Migration\down()} method for the "downgrading" logic. If you do not need the migration to be revertible, use {@see \Yiisoft\Db\Migration\MigrationInterface}.

Public Methods

Hide inherited methods

Method Description Defined By
down() This method contains the logic to be executed when removing this migration. Yiisoft\Db\Migration\RevertibleMigrationInterface
up() This method contains the logic to be executed when applying this migration. Yiisoft\Db\Migration\MigrationInterface

Method Details

Hide inherited methods

down() public abstract method

This method contains the logic to be executed when removing this migration.

The DB logic implemented here will be enclosed within a DB transaction. Child classes may implement this method instead of {@see \Yiisoft\Db\Migration\down()} if the DB logic needs to be within a transaction.

Note: Not all DBMS support transactions. And some DB queries cannot be put into a transaction. For some examples, please refer to implicit commit.

public abstract void down ( Yiisoft\Db\Migration\MigrationBuilder $b )
$b Yiisoft\Db\Migration\MigrationBuilder

                public function down(MigrationBuilder $b): void;

            
up() public abstract method

Defined in: Yiisoft\Db\Migration\MigrationInterface::up()

This method contains the logic to be executed when applying this migration.

The DB logic implemented here will be enclosed within a DB transaction.

Child classes may implement this method instead of {@see \Yiisoft\Db\Migration\up()} if the DB logic needs to be within a transaction.

Note: Not all DBMS support transactions. And some DB queries cannot be put into a transaction. For some examples, please refer to implicit commit.

public abstract void up ( Yiisoft\Db\Migration\MigrationBuilder $b )
$b Yiisoft\Db\Migration\MigrationBuilder

                public function up(MigrationBuilder $b): void;