Metadata-Version: 2.1
Name: migratore
Version: 0.5.8
Summary: Migratore Infra-structure
Home-page: http://migratore.hive.pt
Author: Hive Solutions Lda.
Author-email: development@hive.pt
License: Apache Software License
Keywords: migratore migration sql
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Topic :: Utilities
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2.6
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3.0
Classifier: Programming Language :: Python :: 3.1
Classifier: Programming Language :: Python :: 3.2
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Description-Content-Type: text/markdown

# [![Migratore](res/logo.png)](http://migratore.hive.pt)

Simple migration framework / infra-structure for SQL-based databases.

## Installation

```bash
pip install migratore
```

## Execution

```bash
HOST=${HOST} DB=${DB_NAME} USERNAME=${DB_USER} PASSWORD=${DB_PASS} migratore upgrade
```

## Variables

* `HOST` - Hostname or IP address of the database system for migration
* `PORT` - TCP port to be used in the connection with the database system
* `UNIX_SOCKET` - Filesystem path to the UNIX socket file to be used in connection
* `DB` - Name of the database used as the migration target
* `USERNAME` - Username for authentication in the database
* `PASSWORD` - Password to be used for authentication in the database
* `FS` - Base file system path for file migration (may depend on migration context)
* `DB_URL` - The database connection URL following the format `protocol://username:password@host:port/db`
* `SAFE` - If the migration operation should be performed in a safe manner.

## Commands

* `help` - Prints a help message about the CLI interface
* `version` - Prints the current version of migratore
* `environ` - Displays the current environment in the standard output
* `list` - Lists the executed migrations on the current database
* `errors` - Lists the various errors from migration of the database
* `trace [id]` - Prints the traceback for the error execution with the provided id
* `rebuild [id]` - Run the partial execution of the migration with the given id
* `upgrade [path]` - Executes the pending migrations using the defined directory or current
* `skip [path]` - Skips the current migration (next to be run) using the defined directory or current
* `generate [path]` - Generates a new migration file into the target path

## Examples

```python
database = Migratore.get_database()
table = database.get_table("users")
table.add_column("username", type = "text")
```

## License

Migratore is currently licensed under the [Apache License, Version 2.0](http://www.apache.org/licenses/).

## Build Automation

[![Build Status](https://github.com/hivesolutions/migratore/workflows/Main%20Workflow/badge.svg)](https://github.com/hivesolutions/migratore/actions)
[![Coverage Status](https://coveralls.io/repos/hivesolutions/migratore/badge.svg?branch=master)](https://coveralls.io/r/hivesolutions/migratore?branch=master)
[![PyPi Status](https://img.shields.io/pypi/v/migratore.svg)](https://pypi.python.org/pypi/migratore)
[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://www.apache.org/licenses/)


