Add dump command (#23)

Adds `dbmate dump` command to write the database schema to a file.

The intent is for this file to be checked in to the codebase, similar to Rails' `schema.rb` (or `structure.sql`) file. This allows developers to share a single file documenting the database schema, and makes it considerably easier to review PRs which add (or change) migrations.

The existing `up`, `migrate`, and `rollback` commands will automatically trigger a schema dump, unless `--no-dump-schema` is passed.

Closes https://github.com/amacneil/dbmate/issues/5
This commit is contained in:
Adrian Macneil 2018-01-22 20:38:40 -08:00 committed by GitHub
parent 54a9fbc859
commit d855ee1ada
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 578 additions and 34 deletions

View file

@ -13,13 +13,13 @@ services:
condition: service_healthy
mysql:
image: mysql
image: mysql:5.7
environment:
MYSQL_ROOT_PASSWORD: root
healthcheck:
test: ["CMD", "mysqladmin", "status", "-proot"]
postgres:
image: postgres
image: postgres:9.6
healthcheck:
test: ["CMD", "pg_isready"]