mirror of
https://github.com/ilyakooo0/reshape.git
synced 2024-11-26 10:34:12 +03:00
Explain the new concept at the top of the README
This allows people new to the project to understand how Reshape works before getting into the technical detail of setting it up and using it (which they may or may not want to do just yet).
This commit is contained in:
parent
9cd9bd395b
commit
b3ead8b2e2
23
README.md
23
README.md
@ -8,6 +8,7 @@ Reshape is designed for Postgres 12 and later.
|
||||
|
||||
*Note: Reshape is **experimental** and should not be used in production. It can (and probably will) destroy your data and break your application.*
|
||||
|
||||
- [How it works](#how-it-works)
|
||||
- [Getting started](#getting-started)
|
||||
- [Installation](#installation)
|
||||
- [Creating your first migration](#creating-your-first-migration)
|
||||
@ -33,9 +34,19 @@ Reshape is designed for Postgres 12 and later.
|
||||
- [`reshape abort`](#reshape-abort)
|
||||
- [`reshape generate-schema-query`](#reshape-generate-schema-query)
|
||||
- [Connection options](#connection-options)
|
||||
- [How it works](#how-it-works)
|
||||
- [License](#license)
|
||||
|
||||
|
||||
## How it works
|
||||
|
||||
Reshape works by creating views that encapsulate the underlying tables, which your application will interact with. During a migration, Reshape will automatically create a new set of views and set up triggers to translate inserts and updates between the old and new schema. This means that every deployment is a three-phase process:
|
||||
|
||||
1. **Start migration** (`reshape migrate`): Sets up views and triggers to ensure both the new and old schema are usable at the same time.
|
||||
2. **Roll out application**: Your application can be gradually rolled out without downtime. The existing deployment will continue using the old schema whilst the new deployment uses the new schema.
|
||||
3. **Complete migration** (`reshape complete`): Removes the old schema and any intermediate data and triggers.
|
||||
|
||||
If the application deployment fails, you should run `reshape abort` which will roll back any changes made by `reshape migrate` without losing data.
|
||||
|
||||
## Getting started
|
||||
|
||||
### Installation
|
||||
@ -460,16 +471,6 @@ The options below can be used with all commands that communicate with Postgres.
|
||||
| `--username` | `postgres` | Postgres username |
|
||||
| `--password` | `postgres` | Postgres password |
|
||||
|
||||
## How it works
|
||||
|
||||
Reshape works by creating views that encapsulate the underlying tables, which your application will interact with. During a migration, Reshape will automatically create a new set of views and set up triggers to translate inserts and updates between the old and new schema. This means that every deployment is a three-phase process:
|
||||
|
||||
1. **Start migration** (`reshape migrate`): Sets up views and triggers to ensure both the new and old schema are usable at the same time.
|
||||
2. **Roll out application**: Your application can be gradually rolled out without downtime. The existing deployment will continue using the old schema whilst the new deployment uses the new schema.
|
||||
3. **Complete migration** (`reshape complete`): Removes the old schema and any intermediate data and triggers.
|
||||
|
||||
If the application deployment fails, you should run `reshape abort` which will roll back any changes made by `reshape migrate` without losing data.
|
||||
|
||||
## License
|
||||
|
||||
Reshape is released under the [MIT license](https://choosealicense.com/licenses/mit/).
|
Loading…
Reference in New Issue
Block a user