Download the PHP package gersonalves/migration without Composer
On this page you can find all versions of the php package gersonalves/migration. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download gersonalves/migration
More information about gersonalves/migration
Files in gersonalves/migration
Download gersonalves/migration
More information about gersonalves/migration
Files in gersonalves/migration
Vendor gersonalves
Package migration
Short Description Package para criar migrations em seu BD
License MIT
Package migration
Short Description Package para criar migrations em seu BD
License MIT
Please rate this library. Is it a good library?
Informations about the package migration
Settings
To configure it you must add it to your composer.
composer require gersonalves/migration
The project has the example files for easy understanding.
Implementation
first, import the necessary files and start your PDO connection.
then select the appropriate place in your code to call to run a migration. and Add:
The second parameter is the configuration, here are some important information.
- table - This is the field to define the migration log table. Default 'migrations'
- migrations_dir - This is the directory to save yours .sql files to migrate. Default is null.
- onlyJSON - if is true, the response have a JSON header. If false the response is an Array. Default false.
- continueWithErrors - If is true, when an error occurs, the other migrations will be persisted and it will return a list with successes and failures. if false, on error the interrupt the migration script and return a throw exception. Default false.
Response example
On JSON Success
Informations
The following features have execution blocking:
DROP, TRUNCATE, DELETE, UPDATE without WHERE.
- In the next update, it will inform you which ones you want to allow.
- For all errors, the "status" is "error" regardless of using JSON or not.
- Only
.sqlfiles will be executed.
Public methods
- static RUN() - This is the framework's main method, responsible for making the necessary validations and executing a migration.
- getJSON() - This method will return the last response generated by the system, whether error or success. It is possible to be called only after the RUN method that will generate some response in JSON format.
- getArray() - is similar to getJSON but is an array response.
- getResponse() - It's the same as all the other two methods. But it will return according to the onlyJSON setting.
All versions of migration with dependencies
PHP Build Version
Package Version
Requires
ext-pdo Version
*
ext-json Version *
ext-json Version *
The package gersonalves/migration contains the following files
Loading the files please wait ...