PHPackages                             dastanaron/yii2-migrate-updater - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. dastanaron/yii2-migrate-updater

ActiveYii2-extension[Database &amp; ORM](/categories/database)

dastanaron/yii2-migrate-updater
===============================

The extension allows you to save data when performing a ./yii migrate/redo

1.0.0(8y ago)047[1 issues](https://github.com/dastanaron/yii2-migrate-updater/issues)MITPHP

Since Jan 12Pushed 8y agoCompare

[ Source](https://github.com/dastanaron/yii2-migrate-updater)[ Packagist](https://packagist.org/packages/dastanaron/yii2-migrate-updater)[ RSS](/packages/dastanaron-yii2-migrate-updater/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

update migration to migrate/redo
================================

[](#update-migration-to-migrateredo)

На русском [ТУТ](README_RU.md)

This extension allows you not to lose data when executing `./yii migrate/redo`

We all know that Yii2 does not have a table update system. There is redo, which removes the table and recreates it according to the specified rules. This is good, but sometimes, You need to update the system, including the tables and still not lose data.

This solution allows this, but provided that the new fields appearing in the table will be with the resolution `null`. In addition, the new table should not delete the old columns.

Then maybe we'll fix it, but in the initial stages it will be like this.

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist dastanaron/yii2-migrate-updater "*"

```

or add

```
"dastanaron/yii2-migrate-updater": "*"

```

to the require section of your `composer.json` file and run

```
php composer.phar update

```

Usage
-----

[](#usage)

The use is fairly simple, you must install this solution and connect the class in your migration class.

To save migrations, you need to connect the migration extension class, and use it, to create their own migrations. In addition, you must declare a public variable with the table name `public $tableName`

```
