Download the PHP package majpage/simple-database-migrations without Composer
On this page you can find all versions of the php package majpage/simple-database-migrations. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download majpage/simple-database-migrations
More information about majpage/simple-database-migrations
Files in majpage/simple-database-migrations
Package simple-database-migrations
Short Description Simple PHP database migrations
License MIT
Informations about the package simple-database-migrations
Simple database migrations
Simple PHP database migrations
Testing
To run unit tests type composer run test
.
Implementation
To implement migrations into existed project add two classes into dependency injection container assuming that db
dependency is a database connection (SimpleDatabase\Client\SqlConnectionInterface
):
Then create bin/migrations
file with the following content:
Commands
All migration commands works on a server on which application runs so on Docker container (access via Docker container's bash) in case of local environment. There is a list of available commands:
bin/migrations status
- returns migrations status; supports the following flags:--full
- returns full information about migrations status,
bin/migrations create
- creates empty migration file to fill with queries,bin/migrations migrate
- implements migrations; supports the following flags:--remove-unknown
- removes unknown migrations (record in database but no corresponding file),
bin/migrations migrate 1234567890
- implements or reverts migration to the given version (e.g.1234567890
),bin/migrations migrate empty
- reverts all migrations.
All versions of simple-database-migrations with dependencies
majpage/simple-database Version ^0.4.2
majpage/simple-structure Version ^0.3.1