Commit graph

62 commits

Author SHA1 Message Date
Adrian Macneil
ac718a23dc
postgres: Automatically create search_path schema when needed (#169)
In #167 we added support for specifying a postgres `search_path`, which is used to store the `schema_migrations` table. However, if the schema does not already exist it will cause an error.

In this PR we automatically create the first schema in the `search_path` if it does not exist.
2020-11-01 15:09:13 +13:00
Adrian Macneil
55a8065efe
postgres: Support custom schema for schema_migrations table (#167)
Instead of hardcoding `schema_migrations` table to the `public` schema, add support for specifying a schema via the `search_path` URL parameter.

**Backwards compatibility note**: If anyone was using the previously undocumented `search_path` behavior (affecting migrations themselves, but always storing the `schema_migrations` table in `public`), you will need to either prepend `public` to your `search_path`, or migrate your `schema_migrations` table to your primary schema:

```sql
ALTER TABLE public.schema_migrations SET SCHEMA myschema;
```

Closes #110
2020-11-01 13:30:35 +13:00
Adrian Macneil
26f17d5141
Document migration order (#160) 2020-09-24 10:14:31 -07:00
Adrian Macneil
4581acafad
Build statically linked binaries (#156)
Prior to this commit, we released two linux binaries:

* `dbmate-linux-amd64` (built with cgo, dynamically linked)
* `dbmate-linux-musl-amd64` (built without cgo, statically linked, no sqlite support)

The statically linked binary is desirable for alpine linux users (or anyone else using musl libc or minimal docker images). The original reason for having two separate binaries was that the easiest method to create a static binary for go is to set `CGO_ENABLED=0`, but unfortunately this also prevented us from building sqlite (which requires cgo).

With this commit, all linux and windows binaries are explicitly statically linked while leaving cgo enabled. Hat tip to https://www.arp242.net/static-go.html which explained the necessary flags to enable this.

As an added bonus, the `dbmate` docker image now now uses a `scratch` base rather than `gcr.io/distroless/base`, reducing the image size from 26.7 MB to 9.8 MB.
2020-08-11 13:05:55 -07:00
Adrian Macneil
073efc996e
Update README.md (#154) 2020-08-08 12:30:22 -07:00
Adrian Macneil
9e2d1b8c3b
Allow setting flags via environment variables (#152) 2020-08-08 11:50:45 -07:00
Adrian Macneil
a9aaaad1fb
Add --url flag (#150) 2020-08-08 11:19:33 -07:00
Ilia Ablamonov
c2dd1bd5af
Add ClickHouse support (#140) 2020-08-07 13:38:48 -07:00
Adrian Macneil
5e128ae6a6
Update README.md (#137) 2020-05-24 20:42:33 -07:00
Nikita Konev
079523c25f Add --wait-timeout option (#127)
Closes #127
2020-05-24 19:51:36 -07:00
Adrian Macneil
ed9e57a4ad
Add postgres support for socket parameter (#136)
Simplifies connecting to postgres via sockets (https://github.com/amacneil/dbmate/issues/107), and standardize the `socket` parameter across both mysql and postgresql.

Closes #107
2020-05-24 17:12:41 -07:00
Adrian Macneil
45a122eb86
Update README.md (#135) 2020-05-24 17:08:16 -07:00
Carlo Suriano
6cd39e1fba Support MySQL connection through unix socket (#131)
Closes #131
2020-05-24 13:00:25 -07:00
Adrian Macneil
a45d03acdb
v1.8.0 (#130) 2020-04-28 17:18:51 -07:00
Adrian Macneil
9d2ec369d8
Add --exit-code and --quiet flags to status command (#124)
Extending the `dbmate status` command with the ability to set an exit code or quiet output, for use in scripts.

Flag names were copied from `git diff` command.
2020-03-15 11:32:48 -07:00
fcarletti
256f92ad19 Add status command (#120)
Add new command to list applied and pending migrations.

Closes #28
Closes #32
Closes #66
Closes #120
2020-03-15 09:43:36 -07:00
Adrian Macneil
f7a3390299
Add make docker-bash helper (#123) 2020-03-15 08:58:05 -07:00
Gonzalo Lucero
9a49f8ec93 Update go get install instructions to use modules
Closes #106
2020-01-02 18:45:28 +13:00
Reuben Thomas-Davis
1e45bd774c Add --wait flag (#112)
 When using dbmate as a container, since the base image is distroless, we can't do `dbmate up && dbmate wait`, which makes config a bit more cumbersome (e.g. in kubernetes an extra initContainer).

Closes #111
Closes #112
2020-01-02 18:16:16 +13:00
thomasdziedzic-pd
810bddaea8 Update README.md (#95)
Update migrate repo to https://github.com/golang-migrate/migrate
2019-10-01 14:58:38 -07:00
Andrea Crotti
325624dbe6 Clarify that it simply uses SQL to define migrations
Closes #94
2019-09-26 09:18:21 -07:00
Adrian Macneil
e5ade066a2
v1.7.0 (#93) 2019-09-24 22:07:17 -07:00
Adrian Macneil
259332bf21
Update readme docker instructions
Closes #87
2019-09-01 21:11:31 -04:00
Adrian Macneil
5a8b38be13
v1.6.0 (#79) 2019-05-27 13:36:35 -07:00
Adrian Macneil
87c22515a9
Remove brew tap from readme (#73)
Dbmate now lives in homebrew/core
2019-05-20 19:21:49 -07:00
Ben Reinhart
02c7bda8a9
Require presence of up block; optional space after -- (#72) 2019-05-20 16:37:20 -07:00
Adrian Macneil
a31e06b438
v1.5.0 (#71) 2019-05-19 20:08:14 -07:00
Ben Reinhart
7ac46ff0f3
Add support for options; transaction option (#68)
* Add support for options; transaction option
2019-05-16 19:39:47 -07:00
Adrian Macneil
7400451fba
Clean up dotfiles and docs (#62) 2018-12-01 22:59:42 -08:00
Adrian Macneil
abc544b368
v1.4.1 (#51) 2018-09-03 21:39:42 -07:00
Adrian Macneil
4710a35da1
Release v1.4.0 (#42) 2018-05-06 18:46:51 -07:00
Adrian Macneil
cacf5de3ec
Add wait command (#35) 2018-04-15 18:37:57 -07:00
Adrian Macneil
6ba419a74b
Move cmd to project root for easier installs (#29) 2018-01-24 11:30:08 -08:00
Adrian Macneil
e03dec8a04 v1.3.0 2018-01-23 17:42:06 -08:00
Adrian Macneil
cc769e9605
Update README.md 2018-01-22 21:51:40 -08:00
Adrian Macneil
c2fc8b5441
Simplify Makefile and docker usage (#24) 2018-01-22 21:49:12 -08:00
Adrian Macneil
2b8b849626
Add schema dump documentation 2018-01-22 21:49:00 -08:00
Adrian Macneil
4e01c75eca
Add docker runtime image (#21)
Closes #17
2018-01-07 19:08:43 -08:00
Adrian Macneil
12e798c691 Update README.md 2017-05-14 16:08:15 -07:00
Adrian Macneil
501c9caa62 Add comparison table to readme (#14) 2017-05-14 12:18:35 -07:00
Adrian Macneil
c4fc848624 Update linux download instructions 2017-03-11 12:59:33 -08:00
Adrian Macneil
b51230b563 Add release version shield 2017-02-28 22:28:49 -08:00
Adrian Macneil
6bad7febaa v1.2.1 2017-02-28 21:54:37 -08:00
Adrian Macneil
93490b2f15 Add musl target for Alpine linux support (#8)
Building with `CGO_ENABLED=0` results in a binary which can run on Alpine linux (with musl libc), but it also disables SQLite support.

Adding an additional target allows people to decide this tradeoff for themselves.
2017-02-28 21:54:01 -08:00
Adrian Macneil
309452450e v1.2.0 2016-08-15 23:18:13 -07:00
Adrian Macneil
058bab453d v1.1.0 2016-08-07 23:31:17 -07:00
Adrian Macneil
54b58d850e Document down command 2016-08-07 23:28:30 -07:00
Adrian Macneil
cc92d8a98a v1.0.1 2016-05-21 22:35:04 -07:00
Adrian Macneil
af328ad341 v1.0.0 2016-05-21 20:01:56 -07:00
Adrian Macneil
c82e92fd5a Add docs 2015-12-04 16:27:18 -08:00