Download the PHP package bytepark/lib-migration without Composer

On this page you can find all versions of the php package bytepark/lib-migration. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package lib-migration

Database migration library

Status

alt text

Lightweight database migration library.

The lib-migration component offers an easy to use API for database migrations controlled from within a project or application, not differentiating between structural or data migrations. The migration workload itself is pure SQL and is currently not verified by the library. The correct syntax and integrity checks are the responsibility of the user.

TODOS / Open Features

Concept

The library defines the public interfaces Connection, Repository and Lock. The instance of the Connection interface provides access to the database that is the subject of change, i.e. the database where one wants to migrate against. Implementations of the following databases are bundled in the component using PDO:

The instance of the Repository interface represent a location where the single work units are persisted. Therefore two repositories must be specified, one representing the source of all the migrations and one representing the history of all already migrated work units. Implementations of two filesystem, a database and a memory located repository are bundled.

When you want to persist in the filesystem, you can choose between a flat and a grouped directory structure. The work units are save in one directory in the first case and a two subdirectory deep structure - depending on the unique ID of the work unit - in the latter case.

As the library is to be used in the context of an application, and as applications are nowadays often parallelized, the Manager depends on a locking mechanism to ensure mutual exclusive execution of the database migrations not already present in the history repository.

The four instances are injected during construction into the Manager class which delegates the migration process.

Installation

The recommended way to install lib-migration is through Composer.

Next, run the Composer command to install the latest stable version of lib-migration:

After installing, you need to require Composer's autoloader:

Usage

Example Filesystem to DB

The migration process scans a defined directory for files with the (default) file extension .mig. The set of files is then diffed against the already migrated set, which is, in the example, persisted in a database table.

Migration file requirements

The single migrations should be named in some descending sortable syntax to express weak dependencies. Recommended is the naming of the files including a date, datetime or timestamp prefix, i.e. 19700101-some-text.mig. The migrations will be processed in the given order of the directory scan.

The content of the specific files is the pure SQL queries to execute against the database.

Bridging Components

Will soon be linked here. Currently we know that the following bridges will be provided, each depending on this component:


All versions of lib-migration with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package bytepark/lib-migration contains the following files

Loading the files please wait ....