Write migration is wasting time. Because every database design was ready, programmers must start to convert database design to code with manual type by keyboard. This is a boring time.
We are in dynobird always work with efficient, we want to remove this step. We try to build dynobird CLI in last month to make this real. Now we release dynobird cli version 0.0.15. This release support some command to generate and import for laravel web framework.
There are two strategies to work with dynobird CLI. Work with existing projects and work with new projects. Dynobird support in both.
- work with new project
- work with existing project
We are released if there are more than two strategies to implement this method, but we hope both strategies can make developer work simple. Feel free to give any criticisms and suggestions to make the developer work better.
1. Work with new project
When working with a new project, use migration:generate if needed to generate migration. This is a very simple way to do it.
Create new project
Make table and relations diagram
Enable access integration and copy token
Open project and clear all migrations file if exist
Move to root project directory
Run dynobird migration:generate. If success it will generate migration file in migrations directory like below.
This is generated migration result like this
Don't forget to run migration file with php artisan migrate
This is result in database viewer mysql work bench
Change table with add new table driver and it's relation
Generate new changed database design
This is result of add new driver table
Run database migration
This is new table driver in physical database
2. work in existing project
Work in existing laravel project is tricky. This need import migration from existing project to dynobird.
This is existing project in database
Make new blank project
Enable integration and copy token
Run dynobird migration:import for import existing migration to dynobird.com
This is result import existing migration in dynobird.com
Add table to this project
Generate latest deign with dynobird migration:generate
with this command will be generate new migration file.
And this is generated result of latest migration
Run laravel migration with php artisan migrate
This result from effected of latest migration in physical database