https://github.com/fairy-select/chronovoyage
Simple database migration framework.
https://github.com/fairy-select/chronovoyage
database migration
Last synced: 6 months ago
JSON representation
Simple database migration framework.
- Host: GitHub
- URL: https://github.com/fairy-select/chronovoyage
- Owner: fairy-select
- License: mit
- Created: 2024-08-24T02:46:23.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-11-17T00:52:05.000Z (over 1 year ago)
- Last Synced: 2026-01-05T06:41:15.931Z (6 months ago)
- Topics: database, migration
- Language: Python
- Homepage: https://chronovoyagemigration.net/
- Size: 10.2 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.txt
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# ChronoVoyage
[](https://pypi.org/project/chronovoyage)
[](https://pypi.org/project/chronovoyage)

[](https://snyk.io/advisor/python/chronovoyage)

Chronovoyage is a simple database migration framework.
[Visit Documentation](https://chronovoyagemigration.net/)
-----
## Table of Contents
- [Simple Usage](#simple-usage)
- [Contributing](#contributing)
- [Security Policy](#security-policy)
- [License](#license)
## Simple Usage
To use MariaDB version, you need the MariaDB development package (`libmariadb-dev` in apt).
```shell
pip install chronovoyage[mariadb]
```
## Usage
First, you should name and initialize a directory.
```shell
chronovoyage init my-project --vendor mariadb
cd my-project
```
Edit `config.json`.
```json
{
"$schema": "https://raw.githubusercontent.com/fairy-select/chronovoyage/main/schema/config.schema.json",
"vendor": "mariadb",
"connection_info": {
"host": "127.0.0.1",
"port": 3306,
"user": "mariadb",
"password": "password",
"database": "test"
}
}
```
Create migration template directory.
```shell
chronovoyage add ddl initial_migration
```
If you create DML,
```shell
chronovoyage add dml second_migration
```
Write up sql to `go.sql`, and rollback sql to `return.sql`.
Then, migrate.
```shell
chronovoyage migrate
```
## Contributing
Please read the following docs before you contribute to this repo:
- [Contributing](CONTRIBUTING.md)
- [Code Of Conduct](CODE_OF_CONDUCT.md)
## Security Policy
We support the latest version based on GitHub's vulnerability alerts.
[Security Policy](SECURITY.md)
## License
`chronovoyage` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.
[License](LICENSE.txt)
## Roadmap
- Support for
- [x] Python 3.8 or later
- [ ] Docker
- Database support
- [x] MariaDB
- [ ] MySQL
- [ ] PostgreSQL
- Migration file support
- [x] SQL (.sql)
- [ ] Shell script (.sh)
- Commands
- ~~new~~ init
- [x] Create migration directory and config file
- ~~generate~~ add
- [x] Create migration files from template
- migrate
- [x] To latest
- [x] To specific version
- [x] From the beginning
- [x] From the middle
- --dry-run
- [ ] Show executing SQL
- [ ] Detect ddl or dml
- ~~status~~ current
- [x] Show current migration status
- rollback
- [x] To version
- test
- [ ] Check if every "migrate -> rollback" operation means do nothing for schema
- [ ] If dml, the operation means do nothing for data (including autoincrement num)
- Other
- [x] CLI logging
- [x] Documentation