Download the PHP package sharkom/yii2-auto-migration without Composer

On this page you can find all versions of the php package sharkom/yii2-auto-migration. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package yii2-auto-migration

yii2-auto-migration

Why a new database migration software?

In agile software development, database migration often requires additional efforts that, if not followed step by step during development, can significantly slow down the deployment phase. Each table variation requires creating a migration and applying it, which takes time and requires a high level of discipline to manage all changes correctly.

Lack of these things, when development needs to proceed quickly, risks compromising the software deployment process, slowing down the development team.

This migration software was born from the idea that this activity is not valuable and should be automated. Based on this idea, we created a system that automatically saves the database schema structure and, during migration, automatically identifies variations and executes the necessary SQL code to apply them without having to write all the migrations or generate them manually table by table.

In addition, the system also implements a rollback procedure that uses the same mechanism and allows you to revert changes.

We do not think that this first version is perfect, but we are already using it, and we are reasonably confident that it handles most possible cases.

What is missing?

  1. Table migration procedure, which also requires moving data.
  2. Restore dump procedure (currently requires manual import).
  3. Verify that the SQL code covers all possible field types.
  4. Properly manage the collation set to maintain the same character set (currently uses the DB's default collation).
  5. Make it usable even with modules that cannot be installed with composer (in vendor) - currently, the system is set to our habit of having a private composer repository for all the modules we develop, but we are aware that not everyone has this habit and would like to make this system more universal.

Certainly, in addition to this, it will be necessary to perform unittests, debugging, and understand if other changes are necessary to make it a complete product.

Any help from the community to implement these features or any other contribution to improve this system will be welcome.

Thank you!


This Yii2 module provides a console controller to automate the creation of migration schemas and the application of tables migrations for modules that follow the pattern specified in the configuration.

Features:

  1. Generate all modules migration schemas
  2. Generate single table migration schemas
  3. Apply all modules migration schemas
  4. Apply single table migration schema
  5. Rollback single table migration
  6. Dump table before apply migration

Installation

The preferred way to install this module is through composer.

Either run

or add

to the require section of your composer.json file.

Usage

To use this module, you need to add it to the modules section of your Yii2 configuration file:

In the pattern param you have to specify the vendor directory for your modules

In order to work each module that needs migrations has to have a MigrationTables.php file that specify the DB table names in its directory (ex. vendor/sharkom/yii2-cron/MigrationTables.php)

Once the module is added, you can use the provided console controller to generate the migration schemas and apply the tables migrations for all the modules that follow the specified pattern in the vendor directory.

To generate all the migration schemas, run the following command:

To generate the migration schema for a single table, run the following command:

To apply all the tables migrations, run the following command:

To apply the tables migration for a single table, run the following command:

To rollback a migration for a single table , run the following command:

Paths


All versions of yii2-auto-migration with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package sharkom/yii2-auto-migration contains the following files

Loading the files please wait ....