Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yiimaker/yii2-gii-migration
Yii2 gii create table migration
https://github.com/yiimaker/yii2-gii-migration
gii-migration yii2-extension yii2-gii yii2-migration
Last synced: 3 months ago
JSON representation
Yii2 gii create table migration
- Host: GitHub
- URL: https://github.com/yiimaker/yii2-gii-migration
- Owner: yiimaker
- License: bsd-3-clause
- Created: 2017-01-09T02:12:44.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-09-11T12:43:05.000Z (over 7 years ago)
- Last Synced: 2024-10-01T00:23:48.907Z (3 months ago)
- Topics: gii-migration, yii2-extension, yii2-gii, yii2-migration
- Language: PHP
- Size: 16.6 KB
- Stars: 8
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Migration generator for Gii
[![Total Downloads](https://poser.pugx.org/yiimaker/yii2-gii-migration/downloads)](https://packagist.org/packages/yiimaker/yii2-gii-migration)
[![Latest Stable Version](https://poser.pugx.org/yiimaker/yii2-gii-migration/v/stable)](https://packagist.org/packages/yiimaker/yii2-gii-migration)
[![Latest Unstable Version](https://poser.pugx.org/yiimaker/yii2-gii-migration/v/unstable)](https://packagist.org/packages/yiimaker/yii2-gii-migration)Installation
------------
#### Install package
Run command
```
composer require yiimaker/yii2-gii-migration
```
or add
```json
"yiimaker/yii2-gii-migration": "~1.0"
```
to the require section of your composer.json.Usage
-----
Configure generator in Gii module configuration
```php
'modules' => [
'gii' => [
// ...
'generators' => [
// ...
'migration' => [
'class' => \ymaker\gii\migration\Generator::class,
],
],
],
],
```Fields
======|Field | Type | Default |Description |
|:-----------------------------------|:------:|:----------------------:|:--------------------------------------------------------------------|
|`$migrationPath` |`string`|`'@console/migrations'` |the path to the folder in which the migration file will be generated |
|`$db` |`string`|`db` |connection to a database |
|`$fields` |`array` |`none` |table fields |
|`$foreignKeys` |`array` |`none` |table foreign keys |
|`$useTablePrefix` |`bool` |`true` |use table prefix |
|`$tableName` |`string`|`none` |table name |
|`$migrationName` |`string`|`none` |migration name |
|`$translationPostfix` |`string`|`'_translation'` |postfix for translation table name |
|`$translationRefColumn` |`string`|`'id'` |name for model column |
|`$translationTableColumn` |`string`|`'model_id'` |name for translation model column |
|`$translationLanguageTableName` |`string`|`'language'` |language table name |
|`$translationLanguageColumnRefName` |`string`|`code` |language column name in language table |
|`$translationLanguageColumnName` |`string`|`'language'` |language column name for translation table |
|`$translationLanguageColumnType` |`string`|`string` |language column type |
|`$translationLanguageColumnParam` |`string`|`null` |language column param |License
-------
[![License](https://poser.pugx.org/yiimaker/yii2-gii-migration/license)](https://packagist.org/packages/yiimaker/yii2-gii-migration)This project is released under the terms of the BSD-3-Clause [license](LICENSE).
Copyright (c) 2017, Yii Maker