I ran into issues setting up Sourcegraph on NixOS, because NixOS, like
some other distros, doesn't have a /bin/bash. We already use /usr/bin/env
in many of our scripts, so this improves consistency, too.
Depending on your particular .psqlrc customizations, omitting the -X
flag from psql invocations may include formatting details in the output:
# psql -c 'copy (select 1) to stdout'
Border style is 2.
Line style is unicode.
1
Time: 0.553 ms
That disrupts downstream tools like grep. The -X flag skips reading the
system psqlrc and local .psqlrc file, which fixes the issue:
# psql -Xc 'copy (select 1) to stdout'
1
We can remove the generate step, and instead rely on the go compiler to
embed the migrations. Additionally I took the opportunity to remove some
copy-pasta code and just have one migrations package.
Co-authored-by: Erik Seliger <erikseliger@me.com>
When I'm working on feature branches that take more than a day or two to
finish, review, and merge, I find that my migrations often end up
conflicting with other people's migrations that have been merged in the
interim. This adds instructions on how to deal with this, based on what
I personally do, and (probably more usefully) bundles the core of the
process into a script that can do most of the dirty work.