goose icon indicating copy to clipboard operation
goose copied to clipboard

proposal: creating and dropping databases

Open mfridman opened this issue 5 years ago • 2 comments

It's possible this is beyond the scope of what goose is intended. Feedback welcome.

Consider adding the ability to create / drop a database either directly with psql/pg_* and friends if found locally, or by pulling & running a lightweight postgres alpine container.

I've been experimenting with an implementation that could be retrofitted into goose to provide this functionality. We've been using it for ~4 months and its been working well. (consistency, reproducibility, etc.)


The ultimate idea is goose could be used not only for migrations, but for all the steps most devs require during local dev and CI.

  1. create a database (if not exists) .. requires docker or psql locally

  2. apply migrations .. pure goose

  3. (separate PR proposal) dump the latest schema file .. requires docker or pg_dump locally

  4. import a DB from a sql file (from step 3) .. requires docker or pg_restore locally

mfridman avatar Dec 08 '20 17:12 mfridman

how about this issue

zhuxubin01 avatar Apr 04 '22 10:04 zhuxubin01

+1

timuckun avatar Apr 11 '22 04:04 timuckun