tjura / yii2-migration-helper
Interactive migration generator for Yii2
Installs: 1 408
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 2
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- php: >=8.1
- ext-readline: *
- yiisoft/yii2: >=2.0.8
This package is auto-updated.
Last update: 2024-12-10 05:02:22 UTC
README
Integration time and difficulty
- Around 5 minutes
- Very easy
Requirements
- PHP >= 8.1
- Yii2 >= 2.0.8
Description && How its works
This is an interactive Yii migrate command expansion. It will help you to create basic migrations using question in command line. This extension basically creating commands according Yii documentation https://www.yiiframework.com/doc/guide/2.0/en/db-migrations
Example output:
yii migrate/create create_post_table --fields="title:string,body:text,author_id:integer:notNull:foreignKey(user)"
Usage
php yii migrate
Available options
- Create table
- Drop table
- Add column
- Drop Column
- Add Junction Table
- Redo last
- Down last
- Create empty migration
- Up
Installation instructions
composer require tjura/yii2-migration-helper
Update your console.php config file
'controllerMap' => [ 'migrate' => [ 'class' => \tjura\migration\commands\MigrateController::class, ] ]
Dev notes
- This project was created for help me understand how to create good quality opensource extension and also to improve everyday tasks when working on Yii2 projects.
What's next
- Improve code quality and write unit tests
- Release improved version for older php 7.x