PHPackages                             tflori/breyta - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. tflori/breyta

ActiveLibrary[Database &amp; ORM](/categories/database)

tflori/breyta
=============

Library for database migrations

v1.1.2(1mo ago)26.6k↑40%[1 PRs](https://github.com/tflori/breyta/pulls)MITPHPPHP ^7.1 || ^8.0CI passing

Since Nov 26Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/tflori/breyta)[ Packagist](https://packagist.org/packages/tflori/breyta)[ RSS](/packages/tflori-breyta/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (10)Dependencies (8)Versions (17)Used By (0)

breyta
======

[](#breyta)

[![.github/workflows/push.yml](https://github.com/tflori/breyta/actions/workflows/push.yml/badge.svg)](https://github.com/tflori/breyta/actions/workflows/push.yml)[![Code Coverage](https://camo.githubusercontent.com/645f0343ebded201b70f3439f929aa65a9af7e16b4bc9ad3416bd15b84caeb8d/68747470733a2f2f716c74792e73682f67682f74666c6f72692f70726f6a656374732f6272657974612f636f7665726167652e737667)](https://qlty.sh/gh/tflori/projects/breyta)[![Maintainability](https://camo.githubusercontent.com/0aaf129f44323eb64255482f78444af41e042597141c25198f83f35764184cfc/68747470733a2f2f716c74792e73682f67682f74666c6f72692f70726f6a656374732f6272657974612f6d61696e7461696e6162696c6974792e737667)](https://qlty.sh/gh/tflori/projects/breyta)[![Latest Stable Version](https://camo.githubusercontent.com/b34cecdcb41299bc2d6a2524a97ba94dcb26bc2a6128c40e004b16f508faf13a/68747470733a2f2f706f7365722e707567782e6f72672f74666c6f72692f6272657974612f762f737461626c652e737667)](https://packagist.org/packages/tflori/breyta)[![Total Downloads](https://camo.githubusercontent.com/613d8485c03a1c74356a0cf3a9b33f66c3a10465fa4184aa7ed1837809f6c5ac/68747470733a2f2f706f7365722e707567782e6f72672f74666c6f72692f6272657974612f646f776e6c6f6164732e737667)](https://packagist.org/packages/tflori/breyta)[![License](https://camo.githubusercontent.com/b4df551c68481afb43ea5d194855a7a826eafed61f9ad19e8554a7349a8c71cc/68747470733a2f2f706f7365722e707567782e6f72672f74666c6f72692f6272657974612f6c6963656e73652e737667)](https://packagist.org/packages/tflori/breyta)

Breyta is a **library** for database migrations. There are a lot of applications for database migrations but no actual library (without any user interface).

Trivia
------

[](#trivia)

I created this library after trying ruckusing-migrations. It's the only one that does not require any additional library to provide a user interface and is mentioned in awesome-php. Unfortunately it seems to be not actively developed and maintained. Also I'm missing some functionality and it is very old, not using PSR-2/4 and namespaces.

The name for this library comes again from the Icelandic language and means "to change".

Concept
-------

[](#concept)

- A migration is a set of database statements
- A migration has to run in a transaction
- Logging is important and goes to the migration table
- No code generating from this library (pure SQL)
- No user interface (API only)
- Generate fancy output and support progress bars

Installation
------------

[](#installation)

We only support and suggest using composer - everything else on your own risk.

```
$ composer require tflori/breyta
```

Usage
-----

[](#usage)

> This might change in the next days till version 1.

Migration Script:

```
