项目作者: hiracchy

项目描述 :
A schema migration tool for Cloud Spanner.
高级语言: Go
项目地址: git://github.com/hiracchy/ratchet.git
创建时间: 2021-02-06T23:08:20Z
项目社区:https://github.com/hiracchy/ratchet

开源协议:MIT License

下载


ratchet

ratchet is a schema migration tool for Cloud Spanner.

Installation

Download the binary from GitHub Releases and drop it in your $PATH.

Usage

You can use by following steps.

1. Initialize the schema for migration

  1. $ ratchet init -p {your-project-id} -i {spanner-instance} -d {spanner-database}
  2. Creating migration table...
  3. Migration table has been created!!

This will create a table to manage migration.

2. Create migration files

  1. $ ratchet new
  2. 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

  1. $ ratchet run -p {your-project-id} -i {spanner-instance} -d {spanner-database}
  2. Migration started.
  3. running 2021-02-07_07-38-03_23229 ... done.
  4. Migration completed!