2017 © Pedro Peláez
 

yii2-extension yii2-migration-proxy

Migration proxy component for Yii2

image

bedezign/yii2-migration-proxy

Migration proxy component for Yii2

  • Tuesday, September 23, 2014
  • by Blizz
  • Repository
  • 2 Watchers
  • 1 Stars
  • 14 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Migration Proxy

Ever had the issue that you have to run some database migrations from a component you use but you find that you have to manually specify the path to do so. If you have multiple environments you also have to remember to run that migration command on all your environments. Working as a part of a bigger team this becomes even more annoying., (*1)

I would love to just include those migrations as part of the main migration flow in the application, so I wrote this proxy., (*2)

Using it is really simple:, (*3)

<?php

class mDDMMYY_HHMMSS_table extends \yii\db\Migration
{
   public function up()
   {
       $this->proxy->migrateUp('mDDMMYY_HHMMSS_vendor_migration');
   }

   public function down()
   {
       $this->proxy->migrateUp('mDDMMYY_HHMMSS_vendor_migration');
   }

   protected function getProxy()
   {
      return new \bedezign\yii2\migrationproxy\MigrationProxy(['migrationPath' => '@vendor/vendor-migration-folder/migrations']);
   }
}

Note that the vendor migrations will be created as separate migration rules in your migration table (so on top of the one your migration file creates), but other than than you don't have to do anything special., (*4)

The Versions

23/09 2014

dev-master

9999999-dev

Migration proxy component for Yii2

  Sources   Download

BSD 3-Clause

The Requires

 

yii2 migration proxy custom folder