Recommend this page to a friend! |
Classes of Insolita | YII2 Migrik | README.md | Download |
|
DownloadMigration Generator- generate migration files (not dumps!) with indexes, and foreign keys, for one table, comma separated list of tables, by part of table name, for all tables by - generate migrations based on table data - in two ways - as batchInsert Query or as insert via model - generate migrations based on PHPDOC and model properties CHANGELOGInstallationNOTE : Use 2.x versions for yii <=2.0.13 The preferred way to install this extension is through composer. Either run
or add
to the require-dev section of your Just install, go to gii and use (By default composer bootstrap hook) ANNOTATION SYNTAXIn general the syntax of column definitions is based on style of yii-migration, only separated by "|" and provide a little more opportunities for reducing code - as you see in examples - empty brackets not necessary - also shortcut expr() will be replaced to defaultExpression() and default() to defaultValue You can add annotations in your model(not necessary AR or yii\\base\\Model or Object or stdClass)
__Supported column annotations:__ - As separate annotation above class or above current variable
- As addition to @property or @var definition
CustomizingUse Own templatesCopy default templates from folders to some project directory, for example Change gii configuration like this
Use own resolver for definition of columns- create new class, inherited from \insolita\migrik\resolver\*ColumnResolver
Use own resolver for definition of indexes or relations- create new class, inherited from \insolita\migrik\resolver\TableResolver - in bootsrap your apps add injection
|