# MigrationInterface

> The MigrationInterface defines the minimum set of methods to be implemented by a database migration.

[API reference](/docs/api/index.md) › [yii](/docs/api/yii/index.md) › [db](/docs/api/yii/db/index.md) › MigrationInterface

| interface | `yii\db\MigrationInterface` |
| --- | --- |
| Since | 2.0 |
| Source | [`framework/db/MigrationInterface.php`](https://github.com/yiisoft/yii2/blob/22.0/framework/db/MigrationInterface.php#L20) |

Implemented by 1 type:

- [`Migration`](/docs/api/yii/db/migration/index.md)

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

Each migration class should provide the [`up()`](/docs/api/yii/db/migrationinterface/index.md#method-up) method containing the logic for "upgrading" the database
and the [`down()`](/docs/api/yii/db/migrationinterface/index.md#method-down) method for the "downgrading" logic.

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`down()`](#method-down) abstract | This method contains the logic to be executed when removing this migration. | `MigrationInterface` |
| [`up()`](#method-up) abstract | This method contains the logic to be executed when applying this migration. | `MigrationInterface` |

## Method details

### down() <span id="method-down"></span>

```php
abstract public function down(): bool
```

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

The default implementation throws an exception indicating the migration cannot be removed.

**Returns**

`bool`: Return a false value to indicate the migration fails and should not proceed further. All other return values mean the migration succeeds.

### up() <span id="method-up"></span>

```php
abstract public function up(): bool
```

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

**Returns**

`bool`: Return a false value to indicate the migration fails and should not proceed further. All other return values mean the migration succeeds.