Skip to content

Instantly share code, notes, and snippets.

View xskif's full-sized avatar

Vitaly Dmitriev xskif

  • Russian Federation, St. Petersburg
View GitHub Profile
@xskif
xskif / ReverseController.php
Last active July 30, 2021 04:26 — forked from bmarston/InitialDbMigrationCommand.php
1) Copy this gist to project/console/controllers. 2) call -- yii reverse/migrate > tmp.migrate.php 3) copy functions to existing migration class.
<?php
namespace console\controllers;
use \Yii;
class ReverseController extends \yii\console\Controller
{
public function actionMigrate() {
// $schema = $args[0];
$tables = Yii::$app->db->schema->getTableSchemas();