Download the PHP package carono/yii2-migrate without Composer

On this page you can find all versions of the php package carono/yii2-migrate. 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-migrate

Scrutinizer Code Quality Latest Stable Version Total Downloads License Build Status Code Coverage

[RUS]

MigrationTrait

To expand the migration capabilities, you must add a trait \carono\yii2migrate\traits\MigrationTrait or extend the migration class from \carono\yii2migrate\Migration

public function tableOptions()

Return the array with the settings for creating tables, where the key is the name of the db driver.
When creating tables through createTable(), if no properties are specified, they will be picked up from this function

public function newTables()

Return an array where the key is the name of the table, and the values are columns with types.
If you call the $this->upNewTables() function, all specified tables will be created via createTable()
If you call the function $this->downNewTables(), all specified table will be deleted using dropTable()

pubic function newColumns()

Return an array where the key is the name of an existing table and the values are columns with types.
If you call the function $this->upNewColumns(), all specified columns will be created using addColumn()
If you call the function $this->downNewColumns(), all specified columns will be deleted after dropColumn()

public function newIndex()

Return an array where the key is the name of an existing table and the values are the index parameters via $this->index()
If you call the $this->upNewIndex() function, all specified indexes will be created via createIndex()
If you call the function $this->downNewIndex(), all specified columns will be deleted using the dropIndex()

Working with foreign keys

Create a table, specifying a foreign key, by table name only

Adding a foreign key column

Adding a foreign key to an existing column

Adding foreign key with auto name

Delete foreign key by column name

Working with indexes

Create an index with an automatic name

Deleting an index by column name

(!) It is necessary to pay attention, if there are several columns on the index, then it is necessary to specify them in the necessary sequence. If there are several indexes with such a set and sequence, all of them will be deleted. (!) Does not work correctly with postgreSQL (https://github.com/yiisoft/yii2/issues/16639)

Pivot tables

To implement many-to-many tables, you can use the $this->pivot() function, a table with 2 keys will be created. The names of the keys in the PivotTable are generated automatically, so they can be set via refColumn() and sourceColumn()

Create a PivotTable by creating a table. The result is the table {{%user}}[id] {{%pv_user_photos}}[user_id, photo_id]

Create a PivotTable by adding a column.

Specify the name of the PivotTable

PivotTrait

Trait to help work with pivot tables.

$company - table model Company (requires trait PivotTrait)
$user - model of table User
PvCompanyDirector - a pivot table of the two models: company and user
Pivot table - a table which contains 2 primary key

Added to the table PvCompanyDirector a bunch of the end user company

Get the PvCompanyDirector model for the company-user bundle

Removed a bunch of the user-company

Remove all users from PvCompanyDirector for this company

Save to a temporary link variable so that you can use them later

The preservation of the ties of a temporary variable.
$clear - completely clears all links before adding

The change in behavior of the migration class

public function createIndex($name, $table, $columns, $unique = false)

public function createTable($table, $columns, $options = null)

public function alterColumn($table, $column, $type)

public function addColumn($table, $column, $type)

public function addPrimaryKey($name, $table, $columns)

public function dropColumn($table, $column)

An example of a complete migration

The resulting database schema


All versions of yii2-migrate with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6.0
yiisoft/yii2 Version ^2.0
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 carono/yii2-migrate contains the following files

Loading the files please wait ....