0 follower

Interface Yiisoft\Db\Migration\MigrationInterface

Implemented byYiisoft\Db\Migration\RevertibleMigrationInterface, Yiisoft\Db\Migration\TransactionalMigrationInterface

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. If you need the migration to be revertible, use Yiisoft\Db\Migration\RevertibleMigrationInterface.

Public Methods

Hide inherited methods

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

Method Details

Hide inherited methods

up() public abstract method

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 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 up( Yiisoft\Db\Migration\MigrationBuilder $b ): void
$b Yiisoft\Db\Migration\MigrationBuilder

                public function up(MigrationBuilder $b): void;