https://github.com/kanjih/ratchet
A schema migration tool for Cloud Spanner.
https://github.com/kanjih/ratchet
golang migration ratchet schema schema-migrations spanner
Last synced: about 1 month ago
JSON representation
A schema migration tool for Cloud Spanner.
- Host: GitHub
- URL: https://github.com/kanjih/ratchet
- Owner: kanjih
- License: mit
- Created: 2021-02-06T23:08:20.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-12-14T09:57:25.000Z (about 4 years ago)
- Last Synced: 2024-11-14T23:34:40.615Z (over 1 year ago)
- Topics: golang, migration, ratchet, schema, schema-migrations, spanner
- Language: Go
- Homepage:
- Size: 37.1 KB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
ratchet
========
ratchet is a schema migration tool for Cloud Spanner.
## Installation
Download the binary from [GitHub Releases][release] and drop it in your `$PATH`.
- [Darwin / Mac][release]
- [Linux][release]
[release]: https://github.com/hiracchy/ratchet/releases/latest
## Usage
You can use by following steps.
### 1. Initialize the schema for migration
```console
$ ratchet init -p {your-project-id} -i {spanner-instance} -d {spanner-database}
Creating migration table...
Migration table has been created!!
```
This will create a table to manage migration.
### 2. Create migration files
```console
$ ratchet new
New migration file has been created in migrations/2021-02-07_07-38-03_23229.sql
```
The above command makes a migration file for DDL.
If you want to make files for DML or Partitioned-DML, please add `--dml` or `--pdml` opition.
### 3. Run migrations
```console
$ ratchet run -p {your-project-id} -i {spanner-instance} -d {spanner-database}
Migration started.
running 2021-02-07_07-38-03_23229 ... done.
Migration completed!
```