Download the PHP package jumilla/laravel-versionia without Composer
On this page you can find all versions of the php package jumilla/laravel-versionia. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-versionia
LARAVEL VERSIONIA
日本語ドキュメント - Japanese
Version based database migration system for Laravel 5.
Laravel Versionia is version based database migration system. It can be used in Laravel 5 and Lumen 5.
Concepts
The feature as "migration" loads standards into Laravel 4 and 5 for management of a database (RDB) schema.
Migration is the mechanism that making of a schema and change are being managed by time series. A PHP class for the mounting of "seed" as which data is defined an early stage of a data base and the artisan command are also offered.
Versionia makes standard migration easier to use.
- Add the programmer specified "version" to migration of Laravel 5.
- As
Seeder
class of Laravel 5 can be distinguished under the name, more than one seed is changed easily. - It's offered by a service provider along architecture of Laravel 5.
- Migration and seed classes can be arranged under the
app
directory.
A service provider is employed as Laravel 5 application and the mechanism that a Composer package offers the function. The definition which are routing and an event listener by a service provider is given, but migrations and seeds can be defined now here.
Installation method
[A] Include Laravel Extension (Laravel).
When using Laravel 5, it's recommendation here. Note: Pacakge Discovery supported.
Use Composer.
Please read the explanation of Laravel Extension for more information.
[B] Include Versionia (Laravel)
Note: Pacakge Discovery supported.
Use Composer.
[C] Include Versionia (Lumen)
When using Lumen, it's recommendation here.
Use Composer.
Next the next code is added to boostrap/app.php
.
Migration version definition
There was Naming Rule in the file name of migration class so far, and an order of migration had been decided by the file generation date and time when you were embedded in the file name.
A group and the version are given specifically every migration class and it's defined by the DatabaseServiceProvider
class in Versionia.
Registration of DatabaseServiceProvider
When making a service provider newly, please register. When using Laravel Extension it's included already, so addition is unnecessary.
Laravel
App\Providers\DatabaseServiceProvider::class
is added to app\config.php
.
Lumen
The next code is added to bootstrap\app.php
.
Version Number
Versionia is using PHP standard function version_compare()
for comparison of a version number.
Please designate a character string of a dot end as a version number.
Migration class
The one generated by make:migration
of Laravel 5 standard can use migration class just as it is.
When arranging in app\Database\Migrations
directory of recommendation, please add namespace App\Database\Migrations
.
The next code is a sample of migration definition.
Seed class
A seed defines test
, staging
, production
by the next sample code.
The 2nd argument of method seeds()
designates test
by designation of a default seed.
A seed class is described as follows.
Commands
database:status
Migration and seed definition, installation state are displayed.
database:upgrade
Run migration method up()
of all groups, then up-to-date。
It's possible to make them seed after migration.
database:clean
Run migation method down()
of all groups, then clean state.
database:refresh
Migration of all groups is redone.
It's same run database:clean
and database:upgrade
.
It's possible to run seed after migration.
database:rollback
The version of the designation group is returned one.
When --all
option specified, remove all version of group.
database:again
Re-run latest migration version of group.
It's same effect as run database:rollback <group>
and database:upgrade
.
It's possible to run seed after migration.
database:seed
Run specified seed.
When omitting <seed>
, run default seed.
Copyright
古川 文生 / Fumio Furukawa ([email protected])
License
MIT
All versions of laravel-versionia with dependencies
illuminate/console Version ^5.5
illuminate/container Version ^5.5
illuminate/contracts Version ^5.5
illuminate/database Version ^5.5
illuminate/support Version ^5.5
jumilla/laravel-source-generator Version ^1.3